mirror of
https://github.com/elder-plinius/binaural-beats-generator.git
synced 2026-02-12 16:52:50 +00:00
19 lines
508 B
JavaScript
19 lines
508 B
JavaScript
chrome.runtime.onInstalled.addListener(() => {
|
|
chrome.storage.sync.set({frequency: '440'});
|
|
});
|
|
|
|
chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
|
|
if (changeInfo.status === 'complete' && /^http/.test(tab.url)) {
|
|
chrome.scripting.executeScript({
|
|
target: {tabId: tabId},
|
|
files: ['binauralGenerator.js']
|
|
});
|
|
}
|
|
});
|
|
|
|
chrome.action.onClicked.addListener((tab) => {
|
|
chrome.scripting.executeScript({
|
|
target: {tabId: tab.id},
|
|
files: ['binauralGenerator.js']
|
|
});
|
|
}); |