devtools: add eval support for dedicated workers#43361
Conversation
Signed-off-by: SharanRP <z8903830@gmail.com>
|
Thanks for the PR, I will review it later today :) |
atbrakhi
left a comment
There was a problem hiding this comment.
Service workers are a bit more complex (see my comment below), but the changes for dedicated workers look good to me.
I’d suggest we land this PR focusing on the dedicated worker global scope first. Maybe we can remove the service worker commit from this PR and handle it in a separate one. That would also give us room to address the potential panic there.
For testing service workers locally, you might want to enable them. This is what I run on my system, since they’re not enabled by default:
RUST_LOG="error,devtools=debug" ./mach run --pref dom_serviceworker_enabled http://localhost:8000/index.html --devtools=6080
| devtools_chan, | ||
| init.from_devtools_sender | ||
| .clone() | ||
| .expect("Guaranteed by ServiceWorker Constructor"), |
There was a problem hiding this comment.
Hmm, I think this could lead to a panic. It looks like init.from_devtools_sender isn’t being set for service workers, so it could end up as None here.
|
You can also reproduce the panic by running: |
|
Thanks, makes sense, I split this PR to dedicated worker scope only and removed the service worker changes. I’ll open a follow-up PR for service workers and handle the from_devtools_sender/panic path there. |
eval support for dedicated workers
Service workers were invisible in the DevTools Threads panel because serviceworker_manager.rs never sent ScriptToDevtoolsControlMsg::NewGlobal. Send it in update_serviceworker using the browsing context, pipeline, worker, and webview IDs, similar to how dedicated workers do it in worker.rs. Fixes servo#43361 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Service workers were invisible in the DevTools Threads panel because serviceworker_manager.rs never sent ScriptToDevtoolsControlMsg::NewGlobal. Send it in update_serviceworker using the browsing context, pipeline, worker, and webview IDs, similar to how dedicated workers do it in worker.rs. Fixes servo#43361 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Service workers were invisible in the DevTools Threads panel because serviceworker_manager.rs never sent ScriptToDevtoolsControlMsg::NewGlobal. Send it in update_serviceworker using the browsing context, pipeline, worker, and webview IDs, similar to how dedicated workers do it in worker.rs. Fixes servo#43361
Service workers were invisible in the DevTools Threads panel because serviceworker_manager.rs never sent ScriptToDevtoolsControlMsg::NewGlobal. Send it in update_serviceworker using the browsing context, pipeline, worker, and webview IDs, similar to how dedicated workers do it in worker.rs. Fixes servo#43361
Added dedicated worker side handling, followed the same pattern used in main script handling by wiring worker global scope to `DebuggerGlobalScope` and invoking `fire_eval` fixes: Part of servo#43317 Signed-off-by: SharanRP <z8903830@gmail.com>

Added dedicated worker side handling, followed the same pattern used in main script handling by wiring worker global scope to
DebuggerGlobalScopeand invokingfire_evalfixes: Part of #43317