Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1012)

Unified Diff: third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js

Issue 1668603003: Devtools: Switch JS execution context to match inspected node (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js b/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js
index d9d112afd364f07db0ca0af07f0bc73b0a1d9cd9..077af779bf1d6180aa809a09ae3931ca0ce48e15 100644
--- a/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js
+++ b/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js
@@ -385,6 +385,15 @@ WebInspector.ElementsPanel.prototype = {
if (selectedNode) {
selectedNode.setAsInspectedNode();
this._lastValidSelectedNode = selectedNode;
+
+ var executionContexts = selectedNode.target().runtimeModel.executionContexts();
+ var nodeFrameId = selectedNode.frameId();
+ for (var context of executionContexts) {
+ if (context.frameId == nodeFrameId) {
+ WebInspector.context.setFlavor(WebInspector.ExecutionContext, context);
+ break;
+ }
+ }
}
WebInspector.notifications.dispatchEventToListeners(WebInspector.NotificationService.Events.SelectedNodeChanged);
this._selectedNodeChangedForTest();
« no previous file with comments | « third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698