simulate inactivity to test service worker?

286 views
Skip to first unread message

Tyler Crews

unread,
Aug 24, 2021, 5:02:38 PM8/24/21
to Chromium Extensions
I'm experiencing a bug where when my extension goes inactive I think it's not recalling the correct values from sync storage.

Is there an easy way to test how your extension behaves when it goes inactive? I've been trying to just wait it out until it goes inactive and that's obviously too time consuming to be effective.

Thanks,
Tyler

wOxxOm

unread,
Aug 25, 2021, 10:24:58 AM8/25/21
to Chromium Extensions, tycr...@gmail.com
You can kill the background script (the service worker) in Chrome's built-in Task manager, invoked via Shift-Esc.

Alternatively, open any page of your extension, open devtools, switch to the Application tab, click "Service worker" in the left pane, which will show a UI where you can start/stop/update the service worker.

Tyler Crews

unread,
Aug 25, 2021, 3:28:48 PM8/25/21
to Chromium Extensions, wOxxOm, Tyler Crews
that's perfect, thanks!
Reply all
Reply to author
Forward
0 new messages