summaryrefslogtreecommitdiff
path: root/src/content
diff options
context:
space:
mode:
authorhackademix2019-10-02 00:22:37 +0200
committerhackademix2019-10-02 00:22:37 +0200
commit1c23d736a009f3adf1abeda3e4772c155b14d930 (patch)
tree4c2fa57070cd08c45e50cf2e093d88b98abdd0c3 /src/content
parenteb4f87d66044085ab2ab22f501ba3455706247e9 (diff)
downloadnoscript-1c23d736a009f3adf1abeda3e4772c155b14d930.tar.gz
noscript-1c23d736a009f3adf1abeda3e4772c155b14d930.tar.xz
noscript-1c23d736a009f3adf1abeda3e4772c155b14d930.zip
Prevent startup race conditions breaking pinned tabs sometimes.
Diffstat (limited to 'src/content')
-rw-r--r--src/content/staticNS.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/content/staticNS.js b/src/content/staticNS.js
index e23fed9..c1dbfa4 100644
--- a/src/content/staticNS.js
+++ b/src/content/staticNS.js
@@ -4,13 +4,12 @@
let backlog = new Set();
let stopAndReload = beforeReloading => {
- stop();
- let navTimes = performance.getEntriesByType && performance.getEntriesByType("navigation")[0];
- debug("Should I reload? %o, now: %s", navTimes, performance.now())
- if (navTimes && navTimes.type === "reload" || performance.now() > 10000) {
+ debug("Should I reload? %o, now: %s", performance.now())
+ if (performance.now() > 10000) {
debug("Won't reload.");
return;
}
+ stop();
setTimeout(() => {
debug("Reloading...");
if (typeof beforeReloading === "function") {