Project

General

Profile

« Previous | Next » 

Revision c744eb0e

Added by jahoti about 2 years ago

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

View differences:

TODOS.org
46 46
  fetch those scripts
47 47
- make extension's all html files proper XHTML
48 48
- split options_main.js into several smaller files
49
- find out what causes storage sometimes not to get initialized under IceCat 60
50 49
- validate settings data on import
51 50

  
52 51
DONE:
52
- find out what causes storage sometimes not to get initialized under IceCat 60 -- DONE? 2021-06-23
53 53
- make it possible to export page settings in some format -- DONE 2021-06-19
54 54
- make it possible to use wildcard urls in settings -- DONE 2021-05-14
55 55
- port to gecko-based browsers -- DONE 2021-05-13
background/background.html
1
<!DOCTYPE html>
2
<!--
3
    Copyright (C) 2021 Wojtek Kosior
4

  
5
    This code is dual-licensed under:
6
    - Asshole license 1.0,
7
    - GPLv3 or (at your option) any later version
8

  
9
    "dual-licensed" means you can choose the license you prefer.
10

  
11
    This code is released under a permissive license because I disapprove of
12
    copyright and wouldn't be willing to sue a violator. Despite not putting
13
    this code under copyleft (which is also kind of copyright), I do not want
14
    it to be made proprietary. Hence, the permissive alternative to GPL is the
15
    Asshole license 1.0 that allows me to call you an asshole if you use it.
16
    This means you're legally ok regardless of how you utilize this code but if
17
    you make it into something nonfree, you're an asshole.
18

  
19
    You should have received a copy of both GPLv3 and Asshole license 1.0
20
    together with this code. If not, please see:
21
    - https://www.gnu.org/licenses/gpl-3.0.en.html
22
    - https://koszko.org/asshole-license.txt
23
  -->
24
<html lang="en">
25
  <head>
26
    <meta charset="utf-8">
27
    <script src="/common/stored_types.js"></script>
28
    <script src="/common/lock.js"></script>
29
    <script src="/common/once.js"></script>
30
    <script src="/common/browser.js"></script>
31
    <script src="./storage.js"></script>
32
    <script src="./message_server.js"></script>
33
    <script src="/common/connection_types.js"></script>
34
    <script src="./storage_server.js"></script>
35
    <script src="/common/url_item.js"></script>
36
    <script src="/common/sha256.js"></script>
37
    <script src="./settings_query.js"></script>
38
    <script src="./page_actions_server.js"></script>
39
    <script src="/common/gen_unique.js"></script>
40
    <script src="./policy_injector.js"></script>
41
    <script src="./main.js"></script>
42
  </head>
43
</html>
manifest.json
73 73
    "web_accessible_resources": [
74 74
    ],
75 75
    "background": {
76
	"page": "background/background.html"
76
	"persistent": true,
77
	"scripts": [
78
	    "common/stored_types.js",
79
	    "common/lock.js",
80
	    "common/once.js",
81
	    "common/browser.js",
82
	    "background/storage.js",
83
	    "background/message_server.js",
84
	    "common/connection_types.js",
85
	    "background/storage_server.js",
86
	    "common/url_item.js",
87
	    "common/sha256.js",
88
	    "background/settings_query.js",
89
	    "background/page_actions_server.js",
90
	    "common/gen_unique.js",
91
	    "background/policy_injector.js",
92
	    "background/main.js"
93
	]
77 94
    },
78 95
    "content_scripts": [
79 96
	{

Also available in: Unified diff