aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjahoti <jahoti@tilde.team>2021-06-23 01:38:07 +0000
committerjahoti <jahoti@tilde.team>2021-06-23 01:38:07 +0000
commitc744eb0ef712cb8391b5092c988a200fd1c0a192 (patch)
tree919469c046cb7280f1c771f0ca375a4237429eac
parentcad85119a1946db08a3529c360376445a5302659 (diff)
downloadbrowser-extension-c744eb0ef712cb8391b5092c988a200fd1c0a192.tar.gz
browser-extension-c744eb0ef712cb8391b5092c988a200fd1c0a192.zip
Fix storage initialization on Icecat 60
This patch fixes storage initialization on Gecko browsers by switching from using a background page to using a list of scripts. It remains a mystery why that should have any effect; the only hint is that browser.runtime.onInstalled does not fire when called from a script loaded in a background page. Signed-off-by: jahoti <jahoti@tilde.team>
-rw-r--r--TODOS.org2
-rw-r--r--background/background.html43
-rw-r--r--manifest.json19
3 files changed, 19 insertions, 45 deletions
diff --git a/TODOS.org b/TODOS.org
index 026bf79..0885342 100644
--- a/TODOS.org
+++ b/TODOS.org
@@ -46,10 +46,10 @@ TODO:
fetch those scripts
- make extension's all html files proper XHTML
- split options_main.js into several smaller files
-- find out what causes storage sometimes not to get initialized under IceCat 60
- validate settings data on import
DONE:
+- find out what causes storage sometimes not to get initialized under IceCat 60 -- DONE? 2021-06-23
- make it possible to export page settings in some format -- DONE 2021-06-19
- make it possible to use wildcard urls in settings -- DONE 2021-05-14
- port to gecko-based browsers -- DONE 2021-05-13
diff --git a/background/background.html b/background/background.html
deleted file mode 100644
index 53a74e9..0000000
--- a/background/background.html
+++ /dev/null
@@ -1,43 +0,0 @@
-<!DOCTYPE html>
-<!--
- Copyright (C) 2021 Wojtek Kosior
-
- This code is dual-licensed under:
- - Asshole license 1.0,
- - GPLv3 or (at your option) any later version
-
- "dual-licensed" means you can choose the license you prefer.
-
- This code is released under a permissive license because I disapprove of
- copyright and wouldn't be willing to sue a violator. Despite not putting
- this code under copyleft (which is also kind of copyright), I do not want
- it to be made proprietary. Hence, the permissive alternative to GPL is the
- Asshole license 1.0 that allows me to call you an asshole if you use it.
- This means you're legally ok regardless of how you utilize this code but if
- you make it into something nonfree, you're an asshole.
-
- You should have received a copy of both GPLv3 and Asshole license 1.0
- together with this code. If not, please see:
- - https://www.gnu.org/licenses/gpl-3.0.en.html
- - https://koszko.org/asshole-license.txt
- -->
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <script src="/common/stored_types.js"></script>
- <script src="/common/lock.js"></script>
- <script src="/common/once.js"></script>
- <script src="/common/browser.js"></script>
- <script src="./storage.js"></script>
- <script src="./message_server.js"></script>
- <script src="/common/connection_types.js"></script>
- <script src="./storage_server.js"></script>
- <script src="/common/url_item.js"></script>
- <script src="/common/sha256.js"></script>
- <script src="./settings_query.js"></script>
- <script src="./page_actions_server.js"></script>
- <script src="/common/gen_unique.js"></script>
- <script src="./policy_injector.js"></script>
- <script src="./main.js"></script>
- </head>
-</html>
diff --git a/manifest.json b/manifest.json
index d3a5980..f7369c6 100644
--- a/manifest.json
+++ b/manifest.json
@@ -73,7 +73,24 @@
"web_accessible_resources": [
],
"background": {
- "page": "background/background.html"
+ "persistent": true,
+ "scripts": [
+ "common/stored_types.js",
+ "common/lock.js",
+ "common/once.js",
+ "common/browser.js",
+ "background/storage.js",
+ "background/message_server.js",
+ "common/connection_types.js",
+ "background/storage_server.js",
+ "common/url_item.js",
+ "common/sha256.js",
+ "background/settings_query.js",
+ "background/page_actions_server.js",
+ "common/gen_unique.js",
+ "background/policy_injector.js",
+ "background/main.js"
+ ]
},
"content_scripts": [
{