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

Unified Diff: Source/devtools/front_end/components/HandlerRegistry.js

Issue 1180733005: [DevTools] Added missing items to live anchor's context menu (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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: Source/devtools/front_end/components/HandlerRegistry.js
diff --git a/Source/devtools/front_end/components/HandlerRegistry.js b/Source/devtools/front_end/components/HandlerRegistry.js
index 1eae4f7f692bdeac9dbd8ba18cdca62a9064066f..f789acddc832ee65016a28974106c7ef82ff476e 100644
--- a/Source/devtools/front_end/components/HandlerRegistry.js
+++ b/Source/devtools/front_end/components/HandlerRegistry.js
@@ -176,11 +176,10 @@ WebInspector.HandlerRegistry.prototype = {
if (!anchorElement)
return;
- var resourceURL = anchorElement.href;
- if (!resourceURL)
- return;
+ var uiLocation = WebInspector.Linkifier.uiLocationByAnchor(anchorElement);
- var uiSourceCode = WebInspector.networkMapping.uiSourceCodeForURLForAnyTarget(resourceURL);
+ var resourceURL = uiLocation ? uiLocation.uiSourceCode.contentURL() : anchorElement.href;
+ var uiSourceCode = uiLocation ? uiLocation.uiSourceCode : (resourceURL ? WebInspector.networkMapping.uiSourceCodeForURLForAnyTarget(resourceURL) : null);
function open()
{
WebInspector.Revealer.reveal(uiSourceCode);
@@ -188,6 +187,8 @@ WebInspector.HandlerRegistry.prototype = {
if (uiSourceCode)
contextMenu.appendItem("Open", open);
+ if (!resourceURL)
+ return;
// Add resource-related actions.
contextMenu.appendItem(WebInspector.openLinkExternallyLabel(), this._openInNewTab.bind(this, resourceURL));

Powered by Google App Engine
This is Rietveld 408576698