1

Here is the code snippet that facilitates the INSPECT ELEMENT in WkWebView

preferences.setValue(true, forKey:"developerExtrasEnabled")

Here is the screenshot of INSPECT ELEMENT working in OSX(right click)

OSx inspect element

Right click is equivalent to Tap & Hold in iOS But I am not able to see anything like I see in OSX

Here is the complete code if anybody wants to try

Durai Amuthan.H
  • 31,670
  • 10
  • 160
  • 241
  • 2
    Are you sure that's how WKWebView is supposed to work on iOS? Normally to inspect webviews you need to plug the phone into your mac and inspect it through the Safari Develop menu. – James P Jan 21 '16 at 15:56
  • It's a completely different OS, there's no concept of right click on iOS. Check this answer for inspecting webviews http://stackoverflow.com/a/12552686/488611 – James P Jan 22 '16 at 14:41
  • @JamesP - Thanks for sharing the link – Durai Amuthan.H Jan 25 '16 at 09:26

1 Answers1

8

Its not possible to do in iOS as WKPreference is not key value coding-compliant for the key developerExtrasEnabled so we can't do this using this approach.

Durai Amuthan.H
  • 31,670
  • 10
  • 160
  • 241