mirror of
https://github.com/obsqrbtz/goose-highlighter.git
synced 2026-04-08 20:19:06 +03:00
chore: remove content script and update manifest for service worker
This commit is contained in:
10
background.js
Normal file
10
background.js
Normal file
@@ -0,0 +1,10 @@
|
||||
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);
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -5,23 +5,19 @@
|
||||
"description": "Highlight text on web pages",
|
||||
"default_locale": "en",
|
||||
"permissions": [
|
||||
"scripting",
|
||||
"storage"
|
||||
],
|
||||
"host_permissions": [
|
||||
"<all_urls>"
|
||||
],
|
||||
"action": {
|
||||
"default_popup": "popup/popup.html",
|
||||
"default_icon": "icons/icon128.png"
|
||||
},
|
||||
"content_scripts": [
|
||||
{
|
||||
"matches": [
|
||||
"<all_urls>"
|
||||
],
|
||||
"js": [
|
||||
"content.js"
|
||||
],
|
||||
"run_at": "document_idle"
|
||||
}
|
||||
],
|
||||
"background": {
|
||||
"service_worker": "background.js"
|
||||
},
|
||||
"icons": {
|
||||
"48": "icons/icon48.png",
|
||||
"128": "icons/icon128.png"
|
||||
|
||||
Reference in New Issue
Block a user