You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When working with a BrowserComponent, it is a lot easier to understand what's going on if you are able to use Safari to debug JavaScript inside the WKWebView. Currently, this is not supported without manually editing generated iOS native code.
Describe the solution you'd like
Calling BrowserComponent.setDebugMode(true) should, ideally, result in a call to wkWebView.inspectable = YES;, and disabling this should set it back to NO.
Describe alternatives you've considered
Manually editing the iOS native code works:
@shannah it seems that having a setBrowserProperty would be the right way to expose this for iOS. Right?
Maybe something generic like the stuff you did on Android?
I've had a look at the change, and I believe that it works in your test case - but I have a feeling that calling setDebugMode(false) later would have no impact, and calling setDebugMode(true) after the browser component has already been displayed would likewise have no impact.
I vaguely expected an implementation that would make use of Display.impl.setBrowserProperty, check for the property being "debug mode" or something similar, then call a new method along the lines of nativeInstance.setBrowserInspectable(PeerComponent browserPeer, Boolean value)
I'm away from my computer this weekend... but I'd be happy to put together a PR showing this implementation on Monday if you'd like.
Is your feature request related to a problem? Please describe.
When working with a
BrowserComponent
, it is a lot easier to understand what's going on if you are able to use Safari to debug JavaScript inside theWKWebView
. Currently, this is not supported without manually editing generated iOS native code.Describe the solution you'd like
Calling
BrowserComponent.setDebugMode(true)
should, ideally, result in a call towkWebView.inspectable = YES;
, and disabling this should set it back toNO
.Describe alternatives you've considered
Manually editing the iOS native code works:
We could also consider adding a build hint that would turn this on or off for an entire project.
Additional context
Reddit discussion: https://www.reddit.com/r/cn1/comments/1idt7ez/webbrowser_javascript_interoperability_debugging/
The text was updated successfully, but these errors were encountered: