Search code examples
c#webviewxamarinmonomac

MonoMac WebView - Show Console or Web Inspector?


Trying to figure out how to show the webkit console or inspector from a MonoMac application. It looks like it can be done in Objective-C by setting WebKitDeveloperExtras.

[USER_DEFAULTS registerDefaults:[NSDictionary dictionaryWithObject: 
[NSNumber numberWithBool:YES] forKey:@"WebKitDeveloperExtras"]];

How can I set WebDeveloperExtras in MonoMac.WebKit.WebView?


Solution

  • Try this:

    var defaults = NSUserDefaults.StandardUserDefaults;
    defaults.SetBool (true, "WebKitDeveloperExtras");
    defaults.Synchronize();