Closed arlee17 closed 2 months ago
Have you tried to modify the logic inside the isNavigable(location: String)
? It is only checking that the newLocation
starts with the BASE_URL. Maybe you can try with a contains
, or a more sophisticated regex approach.
Thank you Felipe for your answer.
Actually I tried with contains
and I get this error:
[INFO:CONSOLE(21)] "Uncaught (in promise) SecurityError: Failed to execute 'pushState' on 'History': A history state object with URL 'https://es-es.mydomain.com/' cannot be created in a document with origin 'https://it-it.mydomain.com' and URL 'https://it-it.mydomain.com/'.", source: https://cdn.jsdelivr.net/npm/@hotwired/turbo@7.3.0/dist/turbo.es2017-esm.min.js
Any other idea? Thanks again!
Hi @arlee17,
Did you get another log right below the one you showed? That states something like:
[INFO:CONSOLE(0)] "Access to fetch at 'https://es-es.mydomain.com/' from origin 'https://it-it.mydomain.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.", source: https://it-it.mydomain.com/ (0)
I miss some backend background here but tweaking the Access-Control-Allow-Origin
may help in this case.
@felipejoglar Thanks again for your answer!
I managed not to exit the app using contains
.
In my application I have several subdomains for example:
it-it.mydomain.com en-us.mydomain.com es-es.mydomain.com
The BASE_URL is mydomain.com
When I try to navigate to these subdomains the emulator browser opens.
Being the same domain shouldn't it stay inside the app? If not, is there a way to not exit the app and visit the subdomains?
Here is my code in the main WebFragment: