I created an add-on that manipulates a speicfic site’s HTML based on the settings the user chooses in the add-on’s 'popup' (the settings are saved with ‘chrome.storage.local’, I just ported my code from chrome and it worked).
When the user opens a specific website, the add-on is supposed to run a continuous (interval) content script that changes the HTML, the problem is that it doesn’t, it requires the user to load the site, then open the add-on 'popup', then return to the site, and then the script starts working.
How can I fix that? How do I make the script run when the user opens the site? This is a problem only on android, not chrome or desktop firefox
Here's the manifest.json-
{
"name": "9gag post filter",
"description": "A post filter for 9GAG.com",
"version": "1.1.2",
"browser_specific_settings": {
"gecko": {
"id": "[email protected]",
"strict_min_version": "42.0"
}
},
"manifest_version": 3,
"permissions": [
"storage"
],
"action": {
"default_popup": "index.html"
},
"content_scripts": [{
"css": ["assets/css/content.css"],
"js": ["assets/js/jquery_slim_mini.js","assets/js/content.js"],
"matches": ["https://9gag.com/*"]
}]
}
And the whole source code (it's open source)
The only solution I've found to this is to edit the manifest and go back to Manifest v2 (using mv2 examples like the old the Beastify demo). Of course that is less than desirable since it breaks compatibility with Chromium-based browsers, but it's worth mentioning I guess.