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
I can see the the mock codorva webview implementation returns null when one request the engine in order to evaluate js code.
I guess one could only implement this method at this point in time in order to allow plugins to be able to evaluate js when they run in capacitor environment.
See here:
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.
Bug Report
Capacitor Version
Platform(s)
Affects only android as far as I know
Current Behavior
When a plugin would like to evaluate a js code and run it in the webview this will crash android app in capacitor.
Expected Behavior
Cordova plugin should work without crashes, or there should be an equivalent plugin I could use
Code Reproduction
Basically use a cordova plugin with the following line in android:
this.webView.getEngine().evaluateJavascript("window.dispatchEvent(new MessageEvent('message', { data: 'data' }));", null);
This code can be found here:
https://github.com/AyogoHealth/cordova-plugin-oauth/blob/a09b837cefb1f17628eef1d6d8dba88877149383/src/android/OAuthPlugin.java#L124
Other Technical Details
npm --version
output: 8.1.2node --version
output: v16.13.2pod --version
output (iOS issues only): 1.11.3Additional Context
I can see the the mock codorva webview implementation returns null when one request the engine in order to evaluate js code.
I guess one could only implement this method at this point in time in order to allow plugins to be able to evaluate js when they run in capacitor environment.
See here:
capacitor/android/capacitor/src/main/java/com/getcapacitor/cordova/MockCordovaWebViewImpl.java
Line 241 in d744cbb
Let me know if this is something that you would like to add to the mock and I might be able to send a PR.
The text was updated successfully, but these errors were encountered: