diff options
author | hackademix | 2018-07-28 23:55:27 +0200 |
---|---|---|
committer | hackademix | 2018-08-01 17:32:16 +0200 |
commit | bc834a034e20f6426cc8f7bd2f29109108e6179e (patch) | |
tree | 7825a8327c5123f93c74bf705a71d1e7085cc655 /src/content | |
parent | a283ea1575f62337ccf6293e2e9121773c22556e (diff) | |
download | noscript-bc834a034e20f6426cc8f7bd2f29109108e6179e.tar.gz noscript-bc834a034e20f6426cc8f7bd2f29109108e6179e.tar.xz noscript-bc834a034e20f6426cc8f7bd2f29109108e6179e.zip |
Fixed updating NoScript reloads tabs with revoked temporary permissions.
Diffstat (limited to 'src/content')
-rw-r--r-- | src/content/content.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/content/content.js b/src/content/content.js index 9f89a65..222cc05 100644 --- a/src/content/content.js +++ b/src/content/content.js @@ -3,7 +3,9 @@ // debug = () => {}; // XPI_ONLY var canScript = true, shouldScript = false; - + +let now = () => performance.now() + performance.timeOrigin; + function createHTMLElement(name) { return document.createElementNS("http://www.w3.org/1999/xhtml", name); } @@ -117,7 +119,9 @@ async function init(oldPage = false) { setTimeout(() => init(), 200); return; } - if (!shouldScript) { + if (!shouldScript && + (document.readyState !== "complete" || + now() - performance.timing.domContentLoadedEvenStart < 5000)) { // Something wrong: scripts can run, permissions say they shouldn't. // Was webRequest bypassed by caching/session restore/service workers? window.stop(); |