iOS Question [ Webview ] how do i read log messages (webview console)?

Waldemar Lima

Well-Known Member
Licensed User
Longtime User
hello, I have some problems with the iPad mini 2 (Ios 12.4.9), I would like to see if there is something on the page that is preventing some webviews from loading properly in this version of Ios or something in that sense, there is a way to read or intercept the webview (console) logs?
 

Semen Matusovskiy

Well-Known Member
Licensed User
If you use local builder, do following (once).

1). Connect a mobile device with Mac by USB cable.
2) Mobile device - enable Web Inspector on iOS
  1. Open the Settings app.
  2. Tap Safari.
  3. Scroll down and select Advanced
  4. Switch Web Inspector to ON
3) Mac - enable the Develop Menu
  1. Choose Safari > Preferences, and click Advanced.
  2. At the bottom of the pane, select the “Show Develop menu in menu bar” checkbox
  3. Choose Develop > Show Web Inspector.

Inside program (after you loaded WebView) add following statements:
B4X:
Dim no As NativeObject = WebView1
no.GetField ("configuration").GetField ("preferences").SetField ("developerExtrasEnabled", True)

This activates a communication with Web-inspector.

MAC: When your program runs, click Development in Safari's top menu. Attach to mobile device. After this you will see console output (and not only).
 
Last edited:
Upvote 0
Top