Changeset 204846 in webkit


Ignore:
Timestamp:
Aug 23, 2016 12:00:49 PM (8 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by Devin Rousso <Devin Rousso> 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
Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r204775 r204846  
     12016-08-23  Devin Rousso  <dcrousso+webkit@gmail.com>
     2
     3        Web Inspector: No open/copy src resource in context menu
     4        https://bugs.webkit.org/show_bug.cgi?id=159028
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        * Localizations/en.lproj/localizedStrings.js:
     9
     10        * UserInterface/Views/DOMTreeElement.js:
     11        (WebInspector.DOMTreeElement.prototype._populateTagContextMenu):
     12        Add options in the context menu of link attributes of DOM nodes to
     13         - Open in New Tab
     14         - Reveal in Resources Tab
     15         - Copy Link Address
     16
    1172016-08-23  Devin Rousso  <dcrousso+webkit@gmail.com>
    218
  • trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js

    r204775 r204846  
    198198localizedStrings["Controls"] = "Controls";
    199199localizedStrings["Cookies"] = "Cookies";
     200localizedStrings["Copy Link Address"] = "Copy Link Address";
    200201localizedStrings["Copy Path to Property"] = "Copy Path to Property";
    201202localizedStrings["Copy Row"] = "Copy Row";
     
    517518localizedStrings["Opacity"] = "Opacity";
    518519localizedStrings["Open"] = "Open";
     520localizedStrings["Open in New Tab"] = "Open in New Tab";
    519521localizedStrings["Option-click to show all units"] = "Option-click to show all units";
    520522localizedStrings["Option-click to show all values"] = "Option-click to show all values";
     
    607609localizedStrings["Reveal in Debugger Tab"] = "Reveal in Debugger Tab";
    608610localizedStrings["Reveal in Original Resource"] = "Reveal in Original Resource";
     611localizedStrings["Reveal in Resources Tab"] = "Reveal in Resources Tab";
    609612localizedStrings["Right"] = "Right";
    610613localizedStrings["Role"] = "Role";
  • trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js

    r204370 r204846  
    644644    _populateTagContextMenu(contextMenu, event)
    645645    {
    646         var node = this.representedObject;
     646        let node = this.representedObject;
    647647        if (!node.isInUserAgentShadowTree()) {
    648             var attribute = event.target.enclosingNodeOrSelfWithClass("html-attribute");
     648            let attribute = event.target.enclosingNodeOrSelfWithClass("html-attribute");
     649
     650            if (event.target && event.target.tagName === "A") {
     651                let url = event.target.href;
     652
     653                contextMenu.appendItem(WebInspector.UIString("Open in New Tab"), () => {
     654                    const frame = null;
     655                    const alwaysOpenExternally = true;
     656                    WebInspector.openURL(url, frame, alwaysOpenExternally);
     657                });
     658
     659                if (WebInspector.frameResourceManager.resourceForURL(url)) {
     660                    contextMenu.appendItem(WebInspector.UIString("Reveal in Resources Tab"), () => {
     661                        let frame = WebInspector.frameResourceManager.frameForIdentifier(node.frameIdentifier);
     662                        WebInspector.openURL(url, frame);
     663                    });
     664                }
     665
     666                contextMenu.appendItem(WebInspector.UIString("Copy Link Address"), () => {
     667                    InspectorFrontendHost.copyText(url);
     668                });
     669
     670                contextMenu.appendSeparator();
     671            }
    649672
    650673            // Add attribute-related actions.
     
    657680
    658681            if (WebInspector.cssStyleManager.canForcePseudoClasses()) {
    659                 var pseudoSubMenu = contextMenu.appendSubMenuItem(WebInspector.UIString("Forced Pseudo-Classes"));
     682                let pseudoSubMenu = contextMenu.appendSubMenuItem(WebInspector.UIString("Forced Pseudo-Classes"));
    660683                this._populateForcedPseudoStateItems(pseudoSubMenu);
    661684                contextMenu.appendSeparator();
Note: See TracChangeset for help on using the changeset viewer.