File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
android/capacitor/src/main/java/com/getcapacitor Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -264,9 +264,12 @@ private void loadWebView() {
264264 // Start the local web server
265265 JSInjector injector = getJSInjector ();
266266 if (WebViewFeature .isFeatureSupported (WebViewFeature .DOCUMENT_START_SCRIPT )) {
267- String allowedOrigin = Uri .parse (appUrl ).buildUpon ().path (null ).fragment (null ).clearQuery ().build ().toString ();
267+ Set <String > allowedOrigins = new HashSet <>(Arrays .asList (
268+ Uri .parse (appUrl ).buildUpon ().path (null ).fragment (null ).clearQuery ().build ().toString (),
269+ "https://localhost"
270+ ));
268271 try {
269- WebViewCompat .addDocumentStartJavaScript (webView , injector .getScriptString (), Collections . singleton ( allowedOrigin ) );
272+ WebViewCompat .addDocumentStartJavaScript (webView , injector .getScriptString (), allowedOrigins );
270273 injector = null ;
271274 } catch (IllegalArgumentException ex ) {
272275 Logger .warn ("Invalid url, using fallback" );
You can’t perform that action at this time.
0 commit comments