MicrosoftEdge / MicrosoftEdge/WebView2Feedback
[feat] Add ability to open the dev tools for a particular Shared worker
@aluhrs13 is already working on this.
Since Jul 18, 2022.
- Dominant language
- PowerShell
- Stars
- 526
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
Is your feature request related to a problem? Please describe.
In our app, we use Shared worker, and so for debugging the app we would like to be able to easily open the shared worker dev tools window. Currently, WebView2's C++ Api only allows us to open the main window Dev tools via opendevtoolswindow - api reference
Describe the solution you'd like and alternatives you've considered
We can follow the approach that Electron exposes for debugging shared workers. There is a pair of functions, getAllSharedWorkers, which returns an ID and the URL of each shared worker registered. Then, there is a function inspectSharedWorkerById, which would open the dev tools window for that shared worker.
Here is pseudocode for a sample use case:
if app.mode == DEBUG:
shared_workers = webView2.getAllSharedWorkers()
for [id, url] in shared_workers:
if belongs_to_this_application(url):
webView2.inspectSharedWorkerById(id)
return
Alternatives
Currently our workaround is to open edge://inspect#workers, then manually click "Inspect" on the worker we want. This is ok in general, but prevents us from doing any automation which could speed up our engineering processes.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.