You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Plus I don't think any of the "keepalive" techniques advocated across the internet actually work reliably.
Here is how I confirmed if keepalives were working (they were not after all):
// background.js// if your keepalive is really working, then this value should always be the same indefinitely conststartTime=Date.now()// this rig is just to have the value printable in the console by some content scriptchrome.runtime.onMessage.addListener(()=>chrome.runtime.sendMessage(startTime))// ... whatever keepalive method you are using
// content-script// should indefinitely print the same value, even hours later chrome.runtime.onMessage.addListener((v)=>console.log(v))setInterval(()=>chrome.runtime.sendMessage(''),3000)// ... whatever keepalive method you are using
You can read about my experience with this issue here.
Within content-script I keep alive service-worker
setInterval(() => sendMessage("WORKER_KEEP_ALIVE_MESSAGE", ''),5000);
When the extension is updated, the content-script loses connection to the background and generates an error "Extension context invalidated".
How can I fix it?
The text was updated successfully, but these errors were encountered: