diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/content/content.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/content/content.js b/src/content/content.js index 3560e57..9f89a65 100644 --- a/src/content/content.js +++ b/src/content/content.js @@ -78,10 +78,15 @@ if (document.readyState !== "complete") { } else { init(true); } -let notifyPage = () => { +let notifyPage = async () => { + debug("Page %s shown, %s", document.URL, document.readyState); if (document.readyState === "complete") { - browser.runtime.sendMessage({type: "pageshow", seen, canScript}); - return true; + try { + await browser.runtime.sendMessage({type: "pageshow", seen: seen.list, canScript}); + return true; + } catch (e) { + debug(e); + } } return false; } @@ -166,5 +171,6 @@ async function init(oldPage = false) { }, true); // document.write("<plaintext>"); } - notifyPage() || addEventListener("pageshow", notifyPage); + notifyPage(); + addEventListener("pageshow", notifyPage); } |