Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/components/ExecutionContextSelector.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/components/ExecutionContextSelector.js b/third_party/WebKit/Source/devtools/front_end/components/ExecutionContextSelector.js |
| index 442321322d2a0efb5c1c9d7d100a069045bed320..3ac34873f1e11a6c75bc97cfed773e1a59a778e9 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/components/ExecutionContextSelector.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/components/ExecutionContextSelector.js |
| @@ -132,9 +132,12 @@ WebInspector.ExecutionContextSelector.prototype = { |
| */ |
| _isMainFrameContext: function(executionContext) |
|
pfeldman
2016/07/07 17:44:14
The name is misleading - we want to know whether t
eostroukhov-old
2016/07/13 23:30:58
Done. Note that the main target check is by checki
|
| { |
| - if (!executionContext.isDefault) |
| + if (!executionContext.isDefault || !executionContext.frameId) |
| return false; |
| - var frame = executionContext.target().resourceTreeModel.frameForId(executionContext.frameId); |
| + var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(executionContext.target()); |
| + if (!resourceTreeModel) |
| + return false; |
| + var frame = resourceTreeModel.frameForId(executionContext.frameId); |
| if (frame && frame.isMainFrame()) |
| return true; |
| return false; |