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
{{ message }}
Repository navigation
[Feature]: Allow configuration of Android WebView Origins for the bridge to work on subdomains #7993
Using only the configured hostname results in the bridge not available in subdomains
Platforms
iOS
Android
Web
Request or proposed solution
We have a use case, where we want to never load a local index.html file but load a remote server url e.g., example.org.
Thus we are configuring Capacitor to use the https scheme and the example.org and the https://example.org serverUrl.
Now we are encountering an issue when a redirect is happening on startup, such as https://example.org -> https://www.example.org (subdomain www). The Bridge does not inject JavaScript.
Right now this line in Bridge.java limits our use case:
A single value is used in the Collection which is example.org where www.example.org does not match example.org. To navigate around this issue we were using the workaround to use *.example.org as our hostname, the wildcard matches any subdomain. With this configuration we unfortunately encountered some issues on some devices with XHR and CORS since it seems to match its origin (example.org) with the hostname (*.example.org).
In my opinion it would be beneficial to keep the configured hostname clean (-> example.org) but additionally provide values that will be added in the Bridge as allowed origins.
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.
Activity
allowNavigation#7454ionitron-bot commentedon May 29, 2025
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.