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

Pausing by default can fail due to missing presContext #2

Closed
simonlindholm opened this issue Jan 26, 2014 · 1 comment
Closed

Pausing by default can fail due to missing presContext #2

simonlindholm opened this issue Jan 26, 2014 · 1 comment
Labels

Comments

@simonlindholm
Copy link
Owner

E.g. if you visit http://existential-elevator.tumblr.com/ and then navigate to page 2, the gifs there (which seem to live within an iframe that gets cached, or something) get animated despite the "Pause GIFs by default" setting. The reason is that

getDwu(win).imageAnimationMode = playing ? 0 : 1;

fails when content-document-global-created runs, because the window lacks a presContext at that point.

We might be able to force a presContext, e.g. through win.matchMedia("(min-width: 1px)");, but somehow it doesn't seem to work, but anyway that's a hack and it's bad for performance and memory.

The only real remaining option is to set the global image.animation_mode pref, and restore it on uninstall.

@simonlindholm
Copy link
Owner Author

E.g. if you visit http://existential-elevator.tumblr.com/ and then navigate to page 2, the gifs there (which seem to live within an iframe that gets cached, or something) get animated despite the "Pause GIFs by default" setting.

That reason is apparently different - at the point when content-document-global-created fires, we haven't yet gotten the right document. document-element-inserted appears to work much better. So this issue is less serious than I thought.

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

No branches or pull requests

1 participant