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

Unified Diff: third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js

Issue 2122353002: [DevTools] Make resource tree model optional (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments Created 4 years, 4 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
Index: third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js
index 486429cc3f224f0c0076684bcaf36d59ff928061..f738480ab24c0a375b5f277c4e1499bdb0325d86 100644
--- a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js
+++ b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js
@@ -472,8 +472,8 @@ WebInspector.DeviceModeView.prototype = {
visiblePageRect.top,
Math.min(pageImage.naturalWidth, screenRect.width),
Math.min(pageImage.naturalHeight, screenRect.height));
- var mainFrame = mainTarget.resourceTreeModel.mainFrame;
- var fileName = mainFrame ? mainFrame.url.trimURL().removeURLFragment() : "";
+ var url = mainTarget && mainTarget.inspectedURL();
+ var fileName = url ? url.trimURL().removeURLFragment() : "";
if (this._model.type() === WebInspector.DeviceModeModel.Type.Device)
fileName += WebInspector.UIString("(%s)", this._model.device().title);
// Trigger download.

Powered by Google App Engine
This is Rietveld 408576698