-
-
Notifications
You must be signed in to change notification settings - Fork 435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Browser Back/Forward buttons issue on iOS Chrome #1954
Comments
I've also replied on Discord (https://discord.com/channels/592327939920494592/592327939920494594/1279105338045632636), but I'll share my findings here as well. By the looks of it this is intended behavior in Chrome/WebKit, as it's a security feature. A I think this is caused by the way Inertia navigates. When a user clicks on a link an XHR request is made, then when the response comes back a call is made to I would think using promises all the way would let the browser figure out the origin of the call is in fact a user-interaction, but not sure if that's the case here. |
Yikes, this isn't good. Thanks for bringing this to our attention. Weird that it only happens in iOS Chrome. Going to have to do some digging into this one... |
Just stumbled upon this as well. The way I worked around this issue for now in Vue is by replacing all references to the <template>
<Link
v-if="supportsPwaLinks"
v-bind="$attrs"
>
<slot/>
</Link>
<a
v-else
v-bind="$attrs"
>
<slot/>
</a>
</template>
<script setup>
import {Link} from '@inertiajs/vue3'
const supportsPwaLinks = !isChromeIos()
function isChromeIos() {
return (
!import.meta.env.SSR
&& /CriOS/i.test(navigator.userAgent)
&& /iphone|ipod|ipad/i.test(navigator.userAgent)
)
}
</script> The line This is horrific, but it's a good enough workaround for our purposes. |
I hooked up my phone to debug in Chrome iOS, and here’s what I found:
I’ll keep digging into this and report back soon. Cc: @reinink |
Turns out the real issue was the sequence of I have just opened #1984 for review. |
Hello, |
The fix is in the current beta release |
The issue is still persisting. Despite the code being the same, it sometimes works and sometimes doesn’t, so this isn’t a permanent solution. |
Version:
@inertiajs/vue2
version: 1.2.0Describe the problem:
Browser history not working properly on iOS Chrome v 128.0.6613.98
When i navigate through my web app and then click browsers "Back" button or using gesture "swipe from left" Chrome does not follow correct path (not navigating to previous page)
I use component from @inertiajs/vue2 package
When i check on iOS Safari or Brave browser everything works fine
Browser back and forward and swipe actions should work properly based on history
Steps to reproduce:
The text was updated successfully, but these errors were encountered: