mirror of
https://github.com/mdn/webextensions-examples.git
synced 2026-04-17 23:08:33 +02:00
Fix for issue 197: make content script load using manifest key instead of executeScript
This commit is contained in:
@@ -8,12 +8,6 @@ function getActiveTab() {
|
||||
|
||||
function cookieUpdate(tabId, changeInfo, tab) {
|
||||
getActiveTab().then((tabs) => {
|
||||
/* inject content script into current tab */
|
||||
|
||||
browser.tabs.executeScript(null, {
|
||||
file: "/content_scripts/updatebg.js"
|
||||
});
|
||||
|
||||
// get any previously set cookie for the current tab
|
||||
var gettingCookies = browser.cookies.get({
|
||||
url: tabs[0].url,
|
||||
|
||||
@@ -36,5 +36,12 @@
|
||||
|
||||
"background": {
|
||||
"scripts": ["background_scripts/background.js"]
|
||||
},
|
||||
|
||||
"content_scripts": [
|
||||
{
|
||||
"matches": ["<all_urls>"],
|
||||
"js": ["content_scripts/updatebg.js"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user