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

Unified Diff: third_party/WebKit/Source/devtools/front_end/bindings/ResourceUtils.js

Issue 2186753002: [DevTools] Track URL through the target (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments addressed Created 4 years, 5 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/bindings/ResourceUtils.js
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/ResourceUtils.js b/third_party/WebKit/Source/devtools/front_end/bindings/ResourceUtils.js
index 97de0586200754321ab7fe0cf5284e3bcb537bf1..202a35f3f175b761b8c411b058292a8f72e99f2d 100644
--- a/third_party/WebKit/Source/devtools/front_end/bindings/ResourceUtils.js
+++ b/third_party/WebKit/Source/devtools/front_end/bindings/ResourceUtils.js
@@ -70,14 +70,16 @@ WebInspector.displayNameForURL = function(url)
if (uiSourceCode)
return uiSourceCode.displayName();
- if (!WebInspector.targetManager.inspectedPageURL())
+ var mainTarget = WebInspector.targetManager.mainTarget();
+ var inspectedURL = mainTarget && mainTarget.inspectedURL();
+ if (!inspectedURL)
return url.trimURL("");
- var parsedURL = WebInspector.targetManager.inspectedPageURL().asParsedURL();
+ var parsedURL = inspectedURL.asParsedURL();
var lastPathComponent = parsedURL ? parsedURL.lastPathComponent : parsedURL;
- var index = WebInspector.targetManager.inspectedPageURL().indexOf(lastPathComponent);
- if (index !== -1 && index + lastPathComponent.length === WebInspector.targetManager.inspectedPageURL().length) {
- var baseURL = WebInspector.targetManager.inspectedPageURL().substring(0, index);
+ var index = inspectedURL.indexOf(lastPathComponent);
+ if (index !== -1 && index + lastPathComponent.length === inspectedURL.length) {
+ var baseURL = inspectedURL.substring(0, index);
if (url.startsWith(baseURL))
return url.substring(index);
}

Powered by Google App Engine
This is Rietveld 408576698