Title: [204846] trunk/Source/WebInspectorUI
Revision
204846
Author
[email protected]
Date
2016-08-23 12:00:49 -0700 (Tue, 23 Aug 2016)

Log Message

Web Inspector: No open/copy src resource in context menu
https://bugs.webkit.org/show_bug.cgi?id=159028

Patch by Devin Rousso <[email protected]> on 2016-08-23
Reviewed by Joseph Pecoraro.

* Localizations/en.lproj/localizedStrings.js:

* UserInterface/Views/DOMTreeElement.js:
(WebInspector.DOMTreeElement.prototype._populateTagContextMenu):
Add options in the context menu of link attributes of DOM nodes to
 - Open in New Tab
 - Reveal in Resources Tab
 - Copy Link Address

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (204845 => 204846)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-08-23 18:56:57 UTC (rev 204845)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-08-23 19:00:49 UTC (rev 204846)
@@ -1,5 +1,21 @@
 2016-08-23  Devin Rousso  <[email protected]>
 
+        Web Inspector: No open/copy src resource in context menu
+        https://bugs.webkit.org/show_bug.cgi?id=159028
+
+        Reviewed by Joseph Pecoraro.
+
+        * Localizations/en.lproj/localizedStrings.js:
+
+        * UserInterface/Views/DOMTreeElement.js:
+        (WebInspector.DOMTreeElement.prototype._populateTagContextMenu):
+        Add options in the context menu of link attributes of DOM nodes to
+         - Open in New Tab
+         - Reveal in Resources Tab
+         - Copy Link Address
+
+2016-08-23  Devin Rousso  <[email protected]>
+
         Web Inspector: Add visual editor for spring() timing-function
         https://bugs.webkit.org/show_bug.cgi?id=159315
 

Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (204845 => 204846)


--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2016-08-23 18:56:57 UTC (rev 204845)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2016-08-23 19:00:49 UTC (rev 204846)
@@ -197,6 +197,7 @@
 localizedStrings["Continue to Here"] = "Continue to Here";
 localizedStrings["Controls"] = "Controls";
 localizedStrings["Cookies"] = "Cookies";
+localizedStrings["Copy Link Address"] = "Copy Link Address";
 localizedStrings["Copy Path to Property"] = "Copy Path to Property";
 localizedStrings["Copy Row"] = "Copy Row";
 localizedStrings["Copy Rule"] = "Copy Rule";
@@ -516,6 +517,7 @@
 localizedStrings["Only show resources with issues"] = "Only show resources with issues";
 localizedStrings["Opacity"] = "Opacity";
 localizedStrings["Open"] = "Open";
+localizedStrings["Open in New Tab"] = "Open in New Tab";
 localizedStrings["Option-click to show all units"] = "Option-click to show all units";
 localizedStrings["Option-click to show all values"] = "Option-click to show all values";
 localizedStrings["Option-click to show source"] = "Option-click to show source";
@@ -606,6 +608,7 @@
 localizedStrings["Reveal in DOM Tree"] = "Reveal in DOM Tree";
 localizedStrings["Reveal in Debugger Tab"] = "Reveal in Debugger Tab";
 localizedStrings["Reveal in Original Resource"] = "Reveal in Original Resource";
+localizedStrings["Reveal in Resources Tab"] = "Reveal in Resources Tab";
 localizedStrings["Right"] = "Right";
 localizedStrings["Role"] = "Role";
 localizedStrings["Rule"] = "Rule";

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js (204845 => 204846)


--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js	2016-08-23 18:56:57 UTC (rev 204845)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js	2016-08-23 19:00:49 UTC (rev 204846)
@@ -643,10 +643,33 @@
 
     _populateTagContextMenu(contextMenu, event)
     {
-        var node = this.representedObject;
+        let node = this.representedObject;
         if (!node.isInUserAgentShadowTree()) {
-            var attribute = event.target.enclosingNodeOrSelfWithClass("html-attribute");
+            let attribute = event.target.enclosingNodeOrSelfWithClass("html-attribute");
 
+            if (event.target && event.target.tagName === "A") {
+                let url = ""
+
+                contextMenu.appendItem(WebInspector.UIString("Open in New Tab"), () => {
+                    const frame = null;
+                    const alwaysOpenExternally = true;
+                    WebInspector.openURL(url, frame, alwaysOpenExternally);
+                });
+
+                if (WebInspector.frameResourceManager.resourceForURL(url)) {
+                    contextMenu.appendItem(WebInspector.UIString("Reveal in Resources Tab"), () => {
+                        let frame = WebInspector.frameResourceManager.frameForIdentifier(node.frameIdentifier);
+                        WebInspector.openURL(url, frame);
+                    });
+                }
+
+                contextMenu.appendItem(WebInspector.UIString("Copy Link Address"), () => {
+                    InspectorFrontendHost.copyText(url);
+                });
+
+                contextMenu.appendSeparator();
+            }
+
             // Add attribute-related actions.
             if (this.editable) {
                 contextMenu.appendItem(WebInspector.UIString("Add Attribute"), this._addNewAttribute.bind(this));
@@ -656,7 +679,7 @@
             }
 
             if (WebInspector.cssStyleManager.canForcePseudoClasses()) {
-                var pseudoSubMenu = contextMenu.appendSubMenuItem(WebInspector.UIString("Forced Pseudo-Classes"));
+                let pseudoSubMenu = contextMenu.appendSubMenuItem(WebInspector.UIString("Forced Pseudo-Classes"));
                 this._populateForcedPseudoStateItems(pseudoSubMenu);
                 contextMenu.appendSeparator();
             }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to