Cannot inspect OSX WKWebView on 10.11

Safari 9.0 simply shows "No Inspectable Applications".


As far as I can see, the 9.0.1 is only available for 10.10.


Can anybody confirm this problem or have a solution?


Thanks

Accepted Reply

To remotely inspect an OS X application with Safari you need to give the OS X application the "com.apple.security.get-task-allow" entitlement with a boolean true (YES) value. That will allow Safari to remotely inspect WKWebViews in your application.


On iOS, similiar entitlements are automatically included in your applications when they are built with a Development Provisioning profile, so no extra step is needed there.


For more information, see the 2014 WWDC Presentation titled "Web Inspector and Modern JavaScript".

https://developer.apple.com/videos/play/wwdc2014-512/

Replies

I can confirm. Same problem here 😟


I am running OS X 10.11 (15A284) with Safari 9.0 and have an app that is using a WKWebView for some content. I am not able to inspect this webview, all I see is "No Inspectable Applications", just as you do.


I've filed a bugreport (23104941)

To remotely inspect an OS X application with Safari you need to give the OS X application the "com.apple.security.get-task-allow" entitlement with a boolean true (YES) value. That will allow Safari to remotely inspect WKWebViews in your application.


On iOS, similiar entitlements are automatically included in your applications when they are built with a Development Provisioning profile, so no extra step is needed there.


For more information, see the 2014 WWDC Presentation titled "Web Inspector and Modern JavaScript".

https://developer.apple.com/videos/play/wwdc2014-512/

Thank you so much. You are - of course - right.


The funny (depending on your point of view) thing is that I had already added an entitlements.plist file to my project, and added the "com.apple.security.get-task-allow" property to that plist but...I hadn't added the plist file under "Code Signing Entitlements"...so the entitlements was never used. Well yes, minor detail.


Once again thanks, I've closed my bugreport.

Just use

self.webView?.configuration.preferences.setValue(true, forKey: "developerExtrasEnabled")

right click WKWebView.

Great ! Thanks