Bug 1563607 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Worker threads associated with service workers which are being used on a page should show up in the debugger's threads pane along with the main thread and normal workers.

The main tricky bit in dealing with service workers is that multiple windows can share service worker threads if they are in the same content process.  If such a shared service worker is paused in one window's debugger, other non-debugged windows might become unusable.  I don't understand some aspects of this behavior, though.  If I open multiple tabs which are running in different processes and accessing a URL associated with the same service worker registration, worker threads for the service worker's script are spawned in each of those processes, which should be able to be paused without interfering with threads in other processes.  If I open enough tabs that multiple tabs are running in one content process, they share the same service worker, though (the service worker script only starts once in that process).  This behavior seems strange and it surprises me that the assignment of tabs to processes has an effect on when service worker scripts run.  The related issue of windows that are connected by window.open() calls sharing service workers seems fine/expected; these windows can access each other's contents and expose a host of existing issues in the debugger like being able to break run-to-completion and trying to interact with paused workers).

Besides this issue, it shouldn't be too hard to show threads for service workers in the threads pane, as they seem in other respects identical to normal worker threads.
Worker threads associated with service workers which are being used on a page should show up in the debugger's threads pane along with the main thread and normal workers.

The main tricky bit in dealing with service workers is that multiple windows can share service worker threads if they are in the same content process.  If such a shared service worker is paused in one window's debugger, other non-debugged windows might become unusable.  I don't understand some aspects of this behavior, though.  If I open multiple tabs which are running in different processes and accessing a URL associated with the same service worker registration, worker threads for the service worker's script are spawned in each of those processes, which should be able to be paused without interfering with threads in other processes.  If I open enough tabs that multiple tabs are running in one content process, they share the same service worker, though (the service worker script only starts once in that process).  This behavior seems strange and it surprises me that the assignment of tabs to processes has an effect on when service worker scripts run.  The related issue of windows that are connected by window.open() calls sharing service workers seems fine/expected; these windows can access each other's contents and expose a host of existing issues in the debugger like being able to break run-to-completion and trying to interact with paused workers.

Besides this issue, it shouldn't be too hard to show threads for service workers in the threads pane, as they seem in other respects identical to normal worker threads.

Back to Bug 1563607 Comment 0