mirror of
https://github.com/obsqrbtz/goose-highlighter.git
synced 2026-04-08 20:19:06 +03:00
18 lines
571 B
JavaScript
18 lines
571 B
JavaScript
chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
|
|
if (changeInfo.status === 'complete' && /^https?:/.test(tab.url)) {
|
|
chrome.scripting.executeScript({
|
|
target: { tabId },
|
|
files: ['main.js']
|
|
}).catch(err => {
|
|
console.warn('Injection failed:', err);
|
|
});
|
|
}
|
|
});
|
|
|
|
chrome.runtime.onInstalled.addListener(() => {
|
|
chrome.storage.local.get(['exceptionsList'], (result) => {
|
|
if (!result.exceptionsList) {
|
|
chrome.storage.local.set({ exceptionsList: [] });
|
|
}
|
|
});
|
|
}); |