From 1c23d736a009f3adf1abeda3e4772c155b14d930 Mon Sep 17 00:00:00 2001 From: hackademix Date: Wed, 2 Oct 2019 00:22:37 +0200 Subject: Prevent startup race conditions breaking pinned tabs sometimes. --- src/content/staticNS.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/content/staticNS.js') 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") { -- cgit v1.2.3