Changeset 224508 in webkit
- Timestamp:
- Nov 6, 2017 1:08:01 PM (6 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r224507 r224508 1 2017-11-06 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: no way to navigate from Resource tree element to its entry in Network Tab 4 https://bugs.webkit.org/show_bug.cgi?id=179328 5 <rdar://problem/35367294> 6 7 Reviewed by Brian Burg. 8 9 * Localizations/en.lproj/localizedStrings.js: 10 New reveal in network tab string. 11 12 * UserInterface/Base/Main.js: 13 (WI.isShowingNetworkTab): 14 Utility to know if the network tab is showing. 15 16 * UserInterface/Views/ContextMenuUtilities.js: 17 (WI.appendContextMenuItemsForSourceCode): 18 (showResourceWithOptions): 19 (WI.appendContextMenuItemsForURL): 20 Generalize context menus for just a URL. 21 22 * UserInterface/Views/TabBrowser.js: 23 (WI.TabBrowser.prototype.bestTabContentViewForRepresentedObject): 24 Support more tab ignore options, this is starting to get icky. We may want to 25 move to just a preferredTab approach, since that is what some of these want. 26 27 * UserInterface/Views/DOMTreeElement.js: 28 (WI.DOMTreeElement.prototype._populateTagContextMenu): 29 Make use of new ContextMenu utility to add menu items for a URL. 30 31 * UserInterface/Views/NetworkTabContentView.js: 32 (WI.NetworkTabContentView.prototype.showRepresentedObject): 33 * UserInterface/Views/NetworkTableContentView.js: 34 (WI.NetworkTableContentView.prototype.showRepresentedObject): 35 Handle showing a Resource in the NetworkTab. We immediately show 36 the details view for it, otherwise we fallback to the list view. 37 1 38 2017-11-06 Joseph Pecoraro <pecoraro@apple.com> 2 39 -
trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
r224499 r224508 780 780 localizedStrings["Reveal in Debugger Tab"] = "Reveal in Debugger Tab"; 781 781 localizedStrings["Reveal in Elements Tab"] = "Reveal in Elements Tab"; 782 localizedStrings["Reveal in Network Tab"] = "Reveal in Network Tab"; 782 783 localizedStrings["Reveal in Original Resource"] = "Reveal in Original Resource"; 783 784 localizedStrings["Reveal in Resources Tab"] = "Reveal in Resources Tab"; -
trunk/Source/WebInspectorUI/UserInterface/Base/Main.js
r224499 r224508 994 994 }; 995 995 996 WI.isShowingNetworkTab = function() 997 { 998 return this.tabBrowser.selectedTabContentView instanceof WI.NetworkTabContentView; 999 }; 1000 996 1001 WI.showTimelineTab = function() 997 1002 { -
trunk/Source/WebInspectorUI/UserInterface/Views/ContextMenuUtilities.js
r224314 r224508 43 43 contextMenu.appendSeparator(); 44 44 45 if (sourceCode.url) { 46 contextMenu.appendItem(WI.UIString("Open in New Tab"), () => { 47 const frame = null; 48 WI.openURL(sourceCode.url, frame, {alwaysOpenExternally: true}); 49 }); 50 51 if (WI.frameResourceManager.resourceForURL(sourceCode.url) && !WI.isShowingResourcesTab()) { 52 contextMenu.appendItem(WI.UIString("Reveal in Resources Tab"), () => { 53 const options = {ignoreNetworkTab: true}; 54 if (location) 55 WI.showSourceCodeLocation(location, options); 56 else 57 WI.showSourceCode(sourceCode, options); 58 }); 59 } 60 61 contextMenu.appendItem(WI.UIString("Copy Link Address"), () => { 62 InspectorFrontendHost.copyText(sourceCode.url); 63 }); 64 } 45 WI.appendContextMenuItemsForURL(contextMenu, sourceCode.url, {sourceCode, location}); 65 46 66 47 if (sourceCode instanceof WI.Resource) { … … 98 79 contextMenu.appendSeparator(); 99 80 } 81 }; 82 83 WI.appendContextMenuItemsForURL = function(contextMenu, url, options) 84 { 85 if (!url) 86 return; 87 88 let {sourceCode, location, frame} = options; 89 function showResourceWithOptions(options) { 90 if (location) 91 WI.showSourceCodeLocation(location, options); 92 else if (sourceCode) 93 WI.showSourceCode(sourceCode, options); 94 else 95 WI.openURL(url, frame, options); 96 } 97 98 contextMenu.appendItem(WI.UIString("Open in New Tab"), () => { 99 const frame = null; 100 WI.openURL(url, frame, {alwaysOpenExternally: true}); 101 }); 102 103 if (WI.frameResourceManager.resourceForURL(url)) { 104 if (!WI.isShowingResourcesTab()) { 105 contextMenu.appendItem(WI.UIString("Reveal in Resources Tab"), () => { 106 showResourceWithOptions({ignoreNetworkTab: true, ignoreSearchTab: true}); 107 }); 108 } 109 if (!WI.isShowingNetworkTab()) { 110 contextMenu.appendItem(WI.UIString("Reveal in Network Tab"), () => { 111 showResourceWithOptions({ignoreResourcesTab: true, ignoreDebuggerTab: true, ignoreSearchTab: true}); 112 }); 113 } 114 } 115 116 contextMenu.appendItem(WI.UIString("Copy Link Address"), () => { 117 InspectorFrontendHost.copyText(sourceCode.url); 118 }); 100 119 }; 101 120 -
trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js
r224456 r224508 740 740 if (event.target && event.target.tagName === "A") { 741 741 let url = event.target.href; 742 743 contextMenu.appendItem(WI.UIString("Open in New Tab"), () => { 744 const frame = null; 745 WI.openURL(url, frame, {alwaysOpenExternally: true}); 746 }); 747 748 if (WI.frameResourceManager.resourceForURL(url)) { 749 contextMenu.appendItem(WI.UIString("Reveal in Resources Tab"), () => { 750 let frame = WI.frameResourceManager.frameForIdentifier(node.frameIdentifier); 751 752 const options = { 753 ignoreNetworkTab: true, 754 ignoreSearchTab: true, 755 }; 756 WI.openURL(url, frame, options); 757 }); 758 } 759 760 contextMenu.appendItem(WI.UIString("Copy Link Address"), () => { 761 InspectorFrontendHost.copyText(url); 762 }); 742 let frame = WI.frameResourceManager.frameForIdentifier(node.frameIdentifier); 743 WI.appendContextMenuItemsForURL(contextMenu, url, {frame}); 763 744 } 764 745 -
trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTabContentView.js
r223778 r224508 99 99 } 100 100 101 showRepresentedObject(representedObject, cookie) 102 { 103 console.assert(this._contentBrowser.currentContentView === this._networkTableContentView); 104 this._networkTableContentView.showRepresentedObject(representedObject, cookie); 105 } 106 101 107 get supportsSplitContentBrowser() 102 108 { -
trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js
r224391 r224508 257 257 } 258 258 259 showRepresentedObject(representedObject, cookie) 260 { 261 console.assert(representedObject instanceof WI.Resource); 262 263 let rowIndex = this._rowIndexForResource(representedObject); 264 if (rowIndex === -1) { 265 this._selectedResource = null; 266 this._table.clearSelectedRow(); 267 this._hideResourceDetailView(); 268 return; 269 } 270 271 this._table.selectRow(rowIndex); 272 } 273 259 274 // NetworkResourceDetailView delegate 260 275 -
trunk/Source/WebInspectorUI/UserInterface/Views/TabBrowser.js
r223778 r224508 130 130 continue; 131 131 132 if (options.ignoreResourcesTab && tabContentView instanceof WI.ResourcesTabContentView) 133 continue; 134 135 if (options.ignoreDebuggerTab && tabContentView instanceof WI.DebuggerTabContentView) 136 continue; 137 132 138 if (tabContentView.canShowRepresentedObject(representedObject)) 133 139 return tabContentView;
Note: See TracChangeset
for help on using the changeset viewer.