0

We have a Xamarin Mac App that contains a WebView. When we load a local html into the view the page stop loading contents (javascript error probably). Only happen in some pages.

Any one knows some way to debug the webview ?(display developer tools, remote debug or similar).

We have used firebug too, but with no lucky..

Thanks in advance.

SushiHangover
  • 73,120
  • 10
  • 106
  • 165

1 Answers1

1

Debugging a UIWebView within Cocoa is a little archaic (with iOS you can perform remote debugging via macOS's Safari).

Note: I am assuming you are using UIWebView as you did not specify MK or UI, or if you are using Xamarin.Forms to host your UI.

Obtain your App's Bundle indentifer:

enter image description here

From the cmd line enable WebKitDeveloperExtras for your app bundle id:

defaults write com.sushihangover.aFormsBaseTestHost WebKitDeveloperExtras -bool true

Run your app (assumably via VS4M), and right click on the web view:

enter image description here

Choose "Inspect Element" and then toggle to the console tab for your javascript debugging.

enter image description here

SushiHangover
  • 73,120
  • 10
  • 106
  • 165