-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
AMP Player: Cannot manipulate history API as it causes issues #31010
Comments
Could you please provide more details on what you are trying to achieve? Listing the repro steps and the expected / actual behavior would be very helpful. |
@Enriqe ^ |
Actually I don't think it's the player but the My thinking is that we should write to the history state when the player is opened and then on navigation from story to story. Then, when clicking backwards on the browser window we should pop those states until the player is closed. WDYT @gmajoulet, any thoughts here? /cc @ampproject/wg-stories |
Wait, the story inside the player affects the top-level history stack? |
The story inside the player would always write in its own window history, never in the top level window. There is a lot of AMP code that makes sure of this. Using this demo we have, I don't see anything being written in the browser history: https://www.gstatic.com/amphtml/stamp/qa/player.html Could you please try to repro this outside of your VueJS context, or check if your application code could be responsible for this? |
I did find this code in your application, do you think that might cause it?
|
@gmajoulet That code isn't affecting it since I have it behind a feature flag and it's turned off. |
I'm also programmatically controlling the player and I see in the example you gave it doesn't. Maybe that could be the issue too. |
Sorry for the delay. I have been able to repro this outside of your codebase. Repro steps:
cc @ampproject/wg-stories |
It seems that updating the An alternative is to use the For cross-origin iframes we will need to remove the iframe, update the |
Yeah, and it seems it couldn't be overridden with any replace function call above it. It would still retain history of the ones on the iframe. |
To update this thread, @Enriqe is working on simplifying some Player code to make the overall library faster and more reliable. These updates will have the nice side effect of fixing this bug. |
What's the issue?
Which AMP version is affected?
cc @Enriqe
The text was updated successfully, but these errors were encountered: