Closed johnrosenbaud11 closed 7 years ago
I did this (in chrome/extension/background
):
chrome.tabs.onUpdated.addListener(async (tabId, changeInfo, tab) => {
if (changeInfo.status !== 'loading') {
return;
}
const result = await isInjected(tabId);
if (chrome.runtime.lastError || result[0]) return;
loadScript('inject', tabId, () => console.log('load inject bundle success!'));
});
Yeah you can modify chrome/extension/background/inject.js
.
I got stuck as this did not work for me
I got stuck as this did not work for me
try to add this on background.js (i pass empty object and this helped me)
chrome.runtime.onInstalled.addListener(function () { chrome.declarativeContent.onPageChanged.removeRules(undefined, function () { chrome.declarativeContent.onPageChanged.addRules([{ conditions: [new chrome.declarativeContent.PageStateMatcher({})], actions: [new chrome.declarativeContent.ShowPageAction()] } ]); }); });
I am trying to allow the extension to work on all websites.
I modified the manifest.json (including the dev version) adding necessary permissions:
"permissions": [ "contextMenus", "management", "tabs", "storage", "https://*/*", "<all_urls>" ],
but it doesn't help, it won't work. Apparently it only works on github, and the matter is dealt with by this variable, which, would only work for github.com (tried replacing it with other websites, won't work)
const arrowURLs = ['^https://github\\.com'];
any clues?
Thanks,