summaryrefslogtreecommitdiff
path: root/src/content/content.js
diff options
context:
space:
mode:
authorhackademix2019-09-29 00:50:43 +0200
committerhackademix2019-09-29 17:29:38 +0200
commitfcd7c4aef0c4b81dafd90ce38f41918ac58da139 (patch)
tree201c9e99b79e6060df9a477beb91e57d19136b6d /src/content/content.js
parentc3dcf300a60f581cb97ce29a4ba76190cb362604 (diff)
downloadnoscript-fcd7c4aef0c4b81dafd90ce38f41918ac58da139.tar.gz
noscript-fcd7c4aef0c4b81dafd90ce38f41918ac58da139.tar.xz
noscript-fcd7c4aef0c4b81dafd90ce38f41918ac58da139.zip
Replace cookie-based hacks with synchronous messaging (currently shimmed) to retrieve fallback and per-tab restriction policies.
Diffstat (limited to 'src/content/content.js')
-rw-r--r--src/content/content.js9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/content/content.js b/src/content/content.js
index e7fb331..eabf7c3 100644
--- a/src/content/content.js
+++ b/src/content/content.js
@@ -58,10 +58,6 @@ var notifyPage = async () => {
debug("Page %s shown, %s", document.URL, document.readyState);
if (document.readyState === "complete") {
try {
- if (!("canScript" in ns)) {
- ns.fetchPolicy();
- return;
- }
await Messages.send("pageshow", {seen: seen.list, canScript: ns.canScript});
return true;
} catch (e) {
@@ -74,8 +70,6 @@ var notifyPage = async () => {
return false;
}
-notifyPage();
-
window.addEventListener("pageshow", notifyPage);
ns.on("capabilities", () => {
@@ -105,3 +99,6 @@ ns.on("capabilities", () => {
notifyPage();
});
+
+ns.fetchPolicy();
+notifyPage();