Created attachment 246793 [details] Reload Inspector context menu Currently, it is possible to reload the Inspector by inspecting it and pressing Command R. There should be a way to do that without opening another Inspector instance. We could add a context menu or/and introduce a shortcut.
<rdar://problem/19870852>
what about closing and reopening it? This will force a new WKWebView to be created and cause a new navigation. Note that either option will not reload new resources from the source directory, so you would have to still run the WebInspectorUI build step.
Anyway, to implement this, here's a sketch: 1. We need to set a WKPageContextMenuClient in InspectorProxy.cpp, near where the other clients are initialized. 2. The callback in there needs to create an array with proposed menu items. I think these are added before Inspect Element, which is generated deep inside WebCore. 3. The item is created using WKContextMenuItemCreateAsAction(kWKContextMenuItemTagReload, WKStringCreateWithUTF8CString("Reload Inspector"), true) 4. Profit!
Created attachment 266202 [details] Proposed Fix This patch won't apply without the dependent patch.
Command-Option-R toggles responsive design mode in Safari. Now, pressing Command-Option-R once enters responsive design mode. Pressing it again, toggles the right sidebar. https://cloudup.com/c-qJT91xLhK
(In reply to comment #5) > Command-Option-R toggles responsive design mode in Safari. > Now, pressing Command-Option-R once enters responsive design mode. > Pressing it again, toggles the right sidebar. > https://cloudup.com/c-qJT91xLhK Whoops, wrong bug.
Thanks for working on this! While we are at it, would it make sense to add a keyboard shortcut too? Maybe Cmd-Ctrl-R.
Comment on attachment 266202 [details] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=266202&action=review > Source/WebInspectorUI/UserInterface/Base/Main.js:888 > + return string; Worthy of a comment. > Source/WebInspectorUI/UserInterface/Base/Main.js:1342 > + proposedContextMenu.appendItem(WebInspector.unlocalizedString("Reload Web Inspector"), () => { Might want to add a separator item.
(In reply to comment #7) > Thanks for working on this! > > While we are at it, would it make sense to add a keyboard shortcut too? > Maybe Cmd-Ctrl-R. I held back from this since we have several reload-related shortcuts already. Do we have a clear system to distinguish shortcuts that affect the inspector vs inspected page? I have been using Cmd-Option- as a prefix for some shortcuts that would typically be in the "View" menu.
(In reply to comment #7) > Thanks for working on this! > > While we are at it, would it make sense to add a keyboard shortcut too? > Maybe Cmd-Ctrl-R. I will add it as Cmd-Opt-Shift-R. This matches Cmd-Opt-Shift-D (Toggle Debug UI). We generally don't use Ctrl and Cmd in shortcuts, since they are the same thing on other platforms.
Committed r192790: <http://trac.webkit.org/changeset/192790>