aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2021-07-12 14:22:41 +0200
committerWojtek Kosior <koszko@koszko.org>2021-07-12 14:22:41 +0200
commit1789f17466847d731d0bafa67b6d76526ca32b1d (patch)
tree43b2e55d4a4ceee1e4ac428dcaa26124f7bc36f9
parentdcfc78b0d175bee7b3b7e273282078d50bd4ca09 (diff)
downloadbrowser-extension-1789f17466847d731d0bafa67b6d76526ca32b1d.tar.gz
browser-extension-1789f17466847d731d0bafa67b6d76526ca32b1d.zip
merge jahoti into master
-rw-r--r--background/nonce_store.js2
-rwxr-xr-xbuild.sh2
-rw-r--r--content/main.js5
-rw-r--r--copyright3
4 files changed, 7 insertions, 5 deletions
diff --git a/background/nonce_store.js b/background/nonce_store.js
index 9370876..e5a0e78 100644
--- a/background/nonce_store.js
+++ b/background/nonce_store.js
@@ -19,7 +19,7 @@ function retrieve_nonce(tabId, frameId, update)
console.log('Nonce for ' + code + ' ' + (update ? 'created/updated' : 'requested'));
if (update)
nonces[code] = gen_nonce();
-
+
return nonces[code];
}
diff --git a/build.sh b/build.sh
index e954ce8..7b01000 100755
--- a/build.sh
+++ b/build.sh
@@ -194,7 +194,7 @@ set_browser() {
main() {
set_browser "$1"
-
+
# placate importers of these, as they are exported by the yet-to-be-created exports_init.js
EXPORTS__browser=exports_init.js
EXPORTS__is_chrome=exports_init.js
diff --git a/content/main.js b/content/main.js
index 3204a8a..b044c82 100644
--- a/content/main.js
+++ b/content/main.js
@@ -18,6 +18,7 @@
* IMPORT is_privileged_url
* IMPORT sanitize_attributes
* IMPORT mozilla_suppress_scripts
+ * IMPORT browser
* IMPORT is_chrome
* IMPORT is_mozilla
* IMPORT start_activity_info_server
@@ -134,9 +135,9 @@ if (!is_privileged_url(document.URL)) {
port.onMessage.removeListener(nonce_capturer);
handle_page_actions(msg[1], port);
};
-
+
port.onMessage.addListener(nonce_capturer);
-
+
} else if (is_whitelisted()) {
/* do not block scripts at all; as a result, there is no need for a green-lighted nonce */
handle_page_actions(null, port);
diff --git a/copyright b/copyright
index 93e241b..6282043 100644
--- a/copyright
+++ b/copyright
@@ -8,9 +8,10 @@ License: GPL-3+-javascript or Alicense-1.0
Files: build.sh
Copyright: 2021 Wojtek Kosior <koszko@koszko.org>
+ 2021 jahoti <jahoti@tilde.team>
License: CC0
-Files: manifest.json common/misc.js content/main.js
+Files: common/misc.js content/main.js
Copyright: 2021 Wojtek Kosior <koszko@koszko.org>
2021 jahoti <jahoti@tilde.team>
License: GPL-3+-javascript or Alicense-1.0