ionic-team / cordova-plugin-ionic-webview

Web View plugin for Cordova, specialized for Ionic apps.
Apache License 2.0
484 stars 391 forks source link

window.WEBVIEW_SERVER_URL is inaccurate for cordova android 10 and causing problems with convertFileSrc #648

Closed CodeWithOz closed 2 years ago

CodeWithOz commented 2 years ago

The window.WEBVIEW_SERVER_URL global variable used by convertFileSrc is no longer accurate when using cordova android 10, because cordova android 10 changed the app protocol to https. The window.WEBVIEW_SERVER_URL still has a value of http://localhost, but it should be https://localhost to match cordova android 10.

For now my workaround is to put

window.WEBVIEW_SERVER_URL = window.origin;

at the beginning of my deviceReady handler.

CodeWithOz commented 2 years ago

Closing this as I can see the scheme preference in the docs. Maybe it's worth updating the default value to https as more and more devs upgrade to cordova android 10.