Fix directly opening a URL in new tab not triggering content script
This commit is contained in:
parent
539d34e82a
commit
1f15f51b4a
@ -1,8 +1,7 @@
|
|||||||
|
browser.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
|
||||||
browser.tabs.onUpdated.addListener(async (tabId, changeInfo, tab) => {
|
|
||||||
if (changeInfo.status !== 'complete') {
|
if (changeInfo.status !== 'complete') {
|
||||||
browser.pageAction.hide(tabId);
|
browser.pageAction.hide(tabId);
|
||||||
await browser.storage.local.remove(`nl_tab_${sender.tab.id}`);
|
browser.storage.local.remove(`nl_tab_${sender.tab.id}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}, { properties: ["status"] });
|
}, { properties: ["status"] });
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
{
|
{
|
||||||
"matches": [ "http://*/*", "https://*/*", "file:///*" ],
|
"matches": [ "http://*/*", "https://*/*", "file:///*" ],
|
||||||
"js": ["content.js"],
|
"js": ["content.js"],
|
||||||
"run_at": "document_end"
|
"run_at": "document_start"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"page_action": {
|
"page_action": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user