Skip to content

Fix IOS opening in safari on wrapped proxy errors#73

Merged
reinabo merged 1 commit intomasterfrom
rt/fix-ios-opening-safari
Feb 16, 2026
Merged

Fix IOS opening in safari on wrapped proxy errors#73
reinabo merged 1 commit intomasterfrom
rt/fix-ios-opening-safari

Conversation

@reinabo
Copy link
Contributor

@reinabo reinabo commented Feb 16, 2026

Fixes IOS app opening the page in Safari when switching from wrapped proxy -> rails.

The bug:

  1. We call throw redirect(resp.url) which contains the entire URL with base domain
  2. Vike sees the url doesn't start with / so decides to call window.location.href=resp.url
  3. Turbolinks IOS decides that this must be opened externally which it does for all window.location.href = {absolute URL} calls and passes this info to AlignableApp
  4. AlignableApp decides to open in safari when turbolinks passes openExternalURL .

The fix:

Convert window.location.href={absolute url} to window.location.href={relative url} when redirecting to the same domain.

Why no tests?

I couldn't find a way to mock the window.location.href setter with playwright. Most things I have tried results in Uncaught TypeError: Cannot redefine property: location.

@reinabo reinabo changed the title Fix IOS opening in safari Fix IOS opening in safari on wrapped proxy errors Feb 16, 2026
@reinabo reinabo requested a review from dajinchu February 16, 2026 19:40
@reinabo reinabo merged commit 58cfe1f into master Feb 16, 2026
2 checks passed
reinabo added a commit that referenced this pull request Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants