Can't change console context when debugger is paused |
|||||
Issue descriptionChrome Version: 60.0.3082.3 OS: macOS 10.12.4 What steps will reproduce the problem? (1) Visit this URI: data:text/html,<iframe src="data:text/html,<button onclick=debugger;>debugger;</button>"></iframe> (2) Open the dev tools. (3) Click the "debugger;" button on the page. (4) Run "document" in the console. What is the expected result? `document` represents the top document, since "top" is selected in the dropdown above the console. What happens instead? `document` represents the iframe. Changing the selection in the dropdown doesn't change the console context. When the debugger isn't paused, the context can be changed.
,
Apr 28 2017
Possibly related to issue 498454 ?
,
Apr 28 2017
,
Apr 28 2017
While on pause, we evaluate everything in the context of selected call frame from Callstack pane. I think we should disable context selector in console to make it more obvious.
,
May 1 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c0fa1cb6658aafa79d065942a1c0b8a99a57dead commit c0fa1cb6658aafa79d065942a1c0b8a99a57dead Author: dgozman <dgozman@chromium.org> Date: Mon May 01 23:45:26 2017 [DevTools] Disable contexts in console selector on pause Depending on selected call frame, we only use one specific context per debugger model to evaluate in while on pause. BUG=716306 Review-Url: https://codereview.chromium.org/2849583006 Cr-Commit-Position: refs/heads/master@{#468489} [modify] https://crrev.com/c0fa1cb6658aafa79d065942a1c0b8a99a57dead/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js [add] https://crrev.com/c0fa1cb6658aafa79d065942a1c0b8a99a57dead/third_party/WebKit/LayoutTests/inspector/console/console-context-selector-expected.txt [add] https://crrev.com/c0fa1cb6658aafa79d065942a1c0b8a99a57dead/third_party/WebKit/LayoutTests/inspector/console/console-context-selector.html [add] https://crrev.com/c0fa1cb6658aafa79d065942a1c0b8a99a57dead/third_party/WebKit/LayoutTests/inspector/console/resources/worker-pause.js [modify] https://crrev.com/c0fa1cb6658aafa79d065942a1c0b8a99a57dead/third_party/WebKit/Source/devtools/front_end/console/ConsoleContextSelector.js [modify] https://crrev.com/c0fa1cb6658aafa79d065942a1c0b8a99a57dead/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
,
May 2 2017
Patch from #c5 makes it impossible to select wrong context when on pause. That's not the best solution, but it will serve fine.
,
May 4 2017
1. @4: The only time a context-selector even seems meaningful is when the code is paused, since DOM structure may not be static when code is running -- aside from all the program objects that are also constantly changing and going in and out of existence, and maybe even continuous program-status dumps flooding the console. 2. It is hard enough to follow complex code without having to repeatedly change source-code views (by changing call-frames) just to see the values of objects isolated in/from iframes. 3. Finally and MOST IMPORTANTLY, when paused in iframe code there may not even be any top-level-document call frames in the call stack to be selected, and when paused in top-level-document code there may not be call frames in the stack for any iframes, so simply selecting the needed call frame may not even be possible. Also remember, top.document may be blocked by cross-origin policy. Ref: Try debugging pages like these: http://www.gamesgames.com/game/sweet-candies http://www.crunchyroll.com/no-game-no-life/episode-1-beginner-653163 --- TWIMC: Given all the closures, promises, proxy objects, deeply nested anonymous functions, dynamic bindings, applied and default parameters, minifying, and other such "hidden" and obscured connections there are now between local functions and the rest of the code, JS is now far worse to debug than even goto-style code is.
,
Oct 4 2017
,
Oct 16 2017
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by sdy@chromium.org
, Apr 28 2017