WS connection from Shared worker is not available
Categories
(DevTools :: Netmonitor, defect, P3)
Tracking
(Not tracked)
People
(Reporter: Levitikus, Unassigned)
References
(Blocks 2 open bugs)
Details
Attachments
(1 file)
|
17.31 KB,
text/plain
|
Details |
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36
Steps to reproduce:
As suggested in the article "new websocket inspector" I tried to take a closer Look at my Websocket-Connection usinf Firefox (dev) [71.0b3]
Website-Layout:
The main Design-Idea is, that several Browser-Tabs can subscribe to the SharedWorker and channel their servermessages through the common Websocket.
The Websocket can communicate some informations back to the Browser-Tabs via direct port-communication, in other cases it (the owning SharedWorker indeed) can broadcast messages to a broadcast-channel other SharedWorkers (like an IndexedDB-SharedWorker) might listen to. For instance an 'update the archive'-operation with a blocking idb-access can be parallelized.
I have shortened the SharedWorker-Scriptfile (s. attachment).
The SharedWorker-Scriptfile is called within the init()-block of the main-page (s. init-snippet). Both of them are translated Typescript-Files.
Hopefully you can make sense of it :-) Otherwise if you come forward with an idea, how I can help with your analysis I'd be glad to be of any help.
So i tired to take a look by using the about:debugging-Panel -> sharedworker + 'inspect'
But I can't find any way to inspect the websocket-connection
Actual results:
No HMI-Option to inspect the Websocket-Connection within the sharedworker-debugging-ui is shown.
Expected results:
A 'netmonitor'-Tab should be shown with the 'Websocket'-Option, or a new Option 'Websocket' should be added next to "CSS|XHR|Requests"
Comment 1•7 years ago
|
||
The priority flag is not set for this bug.
:Honza, could you have a look please?
For more information, please visit auto_nag documentation.
Comment 2•7 years ago
•
|
||
Thanks for the report Sven!
Looks like support for WS connections coming from a worker isn't there yet.
Could you please put together a simple test case (can be online or attached to this bug)
that we could use to reproduce this on our machines?
Thanks,
Honza
Comment 3•6 years ago
|
||
This is likely a bug, but we need a test case.
Honza
Comment 5•6 years ago
|
||
@Sven: any update on the test case?
Honza
Updated•6 years ago
|
Updated•6 years ago
|
Updated•4 years ago
|
Comment 6•3 years ago
|
||
Clear a needinfo that is pending on an inactive user.
Inactive users most likely will not respond; if the missing information is essential and cannot be collected another way, the bug maybe should be closed as INCOMPLETE.
For more information, please visit BugBot documentation.
It appears that this is still an outstanding issue. My company centralized the websocket connection by moving it to a SharedWorker, so that if a user has multiple browser tabs open, they all share the websocket connection. But now I can't debug on Firefox, because there is no websocket information available for the SharedWorker. I have to use chrome as a result.
The previous messages indicate that a test case is necessary. I'd be happy to provide one, but I'm not sure one is necessary really -- just go to about:debugging#/runtime/this-firefox, then inspect a shared worker. After you click "Inspect", you can see that there is no apparent way to view websocket traffic. There is a "XHR" and "Requests" option available, but nothing for websockets.
Comment 8•2 years ago
|
||
Just to echo the above user's comments, my company has also centralized a websocket connection into a SharedWorker but being unable to debug the traffic using Firefox's inspect tools makes it difficult for us to support our Firefox users. Is there any update or chance of a solution on the horizon?
Comment 9•2 years ago
|
||
Here's a test page https://ffx-devtools-websocket-in-shared-worker.glitch.me/
Note that we explicitly disable netmonitor for about:debugging worker toolboxes https://searchfox.org/mozilla-central/rev/669fac9888b173c02baa4c036e980c0c204dfe02/devtools/client/definitions.js#339,357-361,367
Tools.netMonitor = {
...
isToolSupported(toolbox) {
return (
toolbox.target.getTrait("networkMonitor") &&
!toolbox.target.isWorkerTarget
);
...
};
But we may display them in the regular toolbox (see https://bugzilla.mozilla.org/show_bug.cgi?id=1432311#c15)
Description
•