[webkit-help] [Mac Desktop] Show Inspector With Code
jalkut at red-sweater.com
Mon Sep 8 07:20:48 PDT 2014
Hi Koen - is this just for development/debug purposes? You can obtain a reference to the private inspector object for a web view, and then interact with it in various ways. For example, given a reference to WebView* someWebView:
[[someWebView performSelector:@selector(inspector)] performSelector:@selector(show:) withObject:nil];
Should pop up its inspector assuming developer extras are enabled. Obviously you wouldn’t want to rely upon that fragile relationship for a shipping feature, though.
> On Sep 4, 2014, at 8:30 AM, Koen Bok <koen at madebysofa.com> wrote:
> Since the patch to allow developer extras landed:
> I can set the _setDeveloperExtrasEnabled to get the "Inspect Element" menu on a right mouse click. It then nicely opens a new inspector window in my app.
> I would like to show the inspector with a button in my UI, so I was looking how to do that. Can anyone help?
> Thanks, Koen
> webkit-help mailing list
> webkit-help at lists.webkit.org
More information about the webkit-help