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

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..e3c41c11bdf07c712f612c634ad4fe8eb81b7e3c 100644
--- a/Source/devtools/front_end/components/HandlerRegistry.js
+++ b/Source/devtools/front_end/components/HandlerRegistry.js
@@ -176,11 +176,9 @@ WebInspector.HandlerRegistry.prototype = {
if (!anchorElement)
return;
- var resourceURL = anchorElement.href;
- if (!resourceURL)
- return;
-
- var uiSourceCode = WebInspector.networkMapping.uiSourceCodeForURLForAnyTarget(resourceURL);
+ var uiLocation = WebInspector.Linkifier.uiLocationByAnchor(anchorElement);
+ 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 +186,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));
« no previous file with comments | « Source/devtools/front_end/bindings/Linkifier.js ('k') | Source/devtools/front_end/elements/ElementsPanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698