Skip to content

Commit 57ce5c6

Browse files
authored
fix(android): javascript injection not working on urls with query (#7545)
1 parent 0dca917 commit 57ce5c6

File tree

1 file changed

+1
-1
lines changed
  • android/capacitor/src/main/java/com/getcapacitor

1 file changed

+1
-1
lines changed

android/capacitor/src/main/java/com/getcapacitor/Bridge.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ private void loadWebView() {
255255
JSInjector injector = getJSInjector();
256256
if (WebViewFeature.isFeatureSupported(WebViewFeature.DOCUMENT_START_SCRIPT)) {
257257
String allowedOrigin = appUrl;
258-
Uri appUri = Uri.parse(appUrl);
258+
Uri appUri = Uri.parse(appUrl).buildUpon().clearQuery().build();
259259
if (appUri.getPath() != null) {
260260
if (appUri.getPath().equals("/")) {
261261
allowedOrigin = appUrl.substring(0, appUrl.length() - 1);

0 commit comments

Comments
 (0)