Skip to content
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

Iframe refreshes automatically when tab change. #32487

Closed
bluej4ker opened this issue Feb 7, 2021 · 5 comments · Fixed by #32478
Closed

Iframe refreshes automatically when tab change. #32487

bluej4ker opened this issue Feb 7, 2021 · 5 comments · Fixed by #32478

Comments

@bluej4ker
Copy link

There has been a change in amp iframe after the last update. Iframe is automatically refreshed when you switch to a different tab on the site with iframe. Do you have a solution to prevent this?

@kristoferbaxter
Copy link
Contributor

@samouri is this related to #32463?

@samouri
Copy link
Member

samouri commented Feb 8, 2021

@bluej4ker: can you please provide an example reproduction (and especially one where it is undesired). Or describe your use case where this is a problem.

I believe this is the intended behavior for iframes to unload when inactive and then reload when active again.

cc @dvoytenko @jridgewell

@bluej4ker
Copy link
Author

bluej4ker commented Feb 8, 2021

@samouri
wetwetew (1)

Imagine watching a video in a tab. You may experience this problem when we move to a different page. Or imagine that you are opening a pop-up page in iframe, the same problem occurs again.

You may think that we should use different tags for the video, but if we are using our own player system, we have no choice but to use the amp-iframe tag.

@dvoytenko
Copy link
Contributor

This is being fixed in #32478

@jridgewell
Copy link
Contributor

jridgewell commented Feb 8, 2021

Ok, so this is from the same PR that caused #32463. However, #32436 was caused by the interaction with the Owners system leading to an incorrect state.

This seems to be caused because we're interpreting the tab switch (iframes shouldn't unload) the same as a Viewer swipe-to-next-doc (iframes should unload). We'll need to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants