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

Run browsers in modes that disable animations better #133

Open
lencioni opened this issue Nov 3, 2019 · 0 comments
Open

Run browsers in modes that disable animations better #133

lencioni opened this issue Nov 3, 2019 · 0 comments

Comments

@lencioni
Copy link
Contributor

lencioni commented Nov 3, 2019

I know that Happo does some work to try to pause animations to help prevent spurious diffs, however the current techniques are not 100% effective--e.g. when rendering an animated GIF.

I wondered if Happo could run browsers in a way that disables more animations.

I poked around a bit and found this Animation Policy Chrome extension that Google released that does the trick. Trying it out locally, it does exactly what we want for animated GIFs when set to "Disable all image animation". Perhaps Happo can use this extension? It looks like extensions can be loaded with the --load-extension= cli arg, but I'm not entirely sure how to configure it. One option might be to copy the extension locally and modify it to have this behavior by default.

Firefox appears to have a setting image.animation_mode that can be set to 'none' to disable animations. It looks like this can be set in selenium via the FirefoxProfile, e.g.

profile = webdriver.FirefoxProfile();
profile.set_preference('image.animation_mode', 'none');

(There might be some other settings here to improve Firefox as well https://stackoverflow.com/a/21026372/18986)

I didn't spend any time looking into what might be possible in other browsers.

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

No branches or pull requests

1 participant