Bug 275664

Summary: Auto-open DevTools for popups
Product: WebKit Reporter: Jeff Johnson <opendarwin>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: inspector-bugzilla-changes, karlcow, rcaliman, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 17   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=247660

Jeff Johnson
Reported 2024-06-19 06:19:01 PDT
Add a new setting like Google Chrome's "Auto-open DevTools for popups" that automatically opens the web inspector in the new tab for window.open() and target="_blank" links when the web inspector is already open. Otherwise it's very difficult to debug page loading in the new tab, especially if there's any kind of redirect.
Attachments
Razvan Caliman
Comment 1 2024-06-19 09:50:15 PDT
This sounds useful. It's similar to the option to automatically open Web Inspector for JS Contexts in the Safari Develop menu.
Radar WebKit Bug Importer
Comment 2 2024-06-19 09:50:34 PDT
Karl Dubost
Comment 3 2024-06-19 16:13:50 PDT
Razvan, Jeff, I believe this is a duplicate of Bug 247660
Jeff Johnson
Comment 4 2024-06-19 16:27:19 PDT
(In reply to Karl Dubost from comment #3) > Razvan, Jeff, I believe this is a duplicate of Bug 247660 They certainly seem similar, though I'm not sure I understand this part: "The importance is to be able to automatically continue the debugging journey." In one practical sense, you can continue because there's now a new tab open with the web inspector that you can debug (separately). In the sense of stepping through code, however, I'm not sure that you can continue? "Remote URLs won't load immediately. When window.open() returns, the window always contains about:blank. The actual fetching of the URL is deferred and starts after the current script block finishes executing. The window creation and the loading of the referenced resource are done asynchronously." https://developer.mozilla.org/docs/Web/API/Window/open
Karl Dubost
Comment 5 2024-06-19 17:33:52 PDT
In a non-technical term. 1. let's say you click on a link which open a new window or tab to login to a third party 2. I want this to open automatically the web inspector in the new window 3. I want to be already in a step by step breakpoint scenario. 4. When the last step of the breakpoint is happening when the code is closing the window 5. I want to be able to continue the breakpoints as it was when I left. I understand it is a hard problem to solve.
Razvan Caliman
Comment 6 2025-10-03 05:20:34 PDT
Karl, the two requests are independent. You're right that following a JS debugging session across contexts is a hard problem. But automatically opening a Web Inspector session for a popup and immediately pausing execution is solvable. There's a higher chance of getting this implemented instead of the cross-context debugging workflow.
Note You need to log in before you can comment on or make changes to this bug.