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

Disable jQuery animations #5

Open
gwarser opened this issue Jul 8, 2017 · 7 comments
Open

Disable jQuery animations #5

gwarser opened this issue Jul 8, 2017 · 7 comments
Labels

Comments

@gwarser
Copy link

gwarser commented Jul 8, 2017

Animations can be disabled by setting jQuery.fx.off to true

https://api.jquery.com/jquery.fx.off/

@gagarine
Copy link
Owner

gagarine commented Jul 8, 2017

Ohhh that's interesting. I will do some test ASAP. Thanks for the tip.

Of course, if you want to do a pull requests, you are welcome.

@gagarine
Copy link
Owner

gagarine commented Jul 8, 2017

Ok I did a test with https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/tabs/executeScript but this run in some kind of isolated context.

So I think the way to go is to insert a script element in the page, execute it, then remove the element.

@gagarine
Copy link
Owner

Curious also about http://getbootstrap.com/javascript/#transitions
$.support.transition = false

Bootstrap use jQuery, but perhaps they also have their own transitions that would be nice to disable at the JS level.

@NiklasGollenstede
Copy link

NiklasGollenstede commented Jul 15, 2017

but this run in some kind of isolated context.

window.wrappedJSObject.jQuery.fx.off = true;

see: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Content_scripts#Accessing_page_script_objects_from_content_scripts
Note that using wrappedJSObject will probably flag your extension for admin review. And also only works in Firefox(-based) browsers.

@gagarine gagarine changed the title jQuery support? Support jQuery.fx.off to disable jQuery animation Jul 30, 2017
@gagarine gagarine changed the title Support jQuery.fx.off to disable jQuery animation Disable jQuery animations Jul 30, 2017
@gagarine gagarine added bug and removed enhancement labels Sep 22, 2017
@sergeevabc
Copy link

@gagarine, have you abandoned us?

@gagarine
Copy link
Owner

Yes sadly yes. I'm not using the plugin myself anymore as 1) web devs to got tired of this gimmick 2) Firefox handle animation a lot better in term of CPU usage.

I may return to it when I got some free time. I will accept pull requests.

@ssokolow
Copy link

I still use it to disable things like the scrolling backgrounds at https://www.humblebundle.com/ and I wish I had time to write a PR to make it toggle things per-page because it causes "freeze up the entire tab"-level fatal breakages in situations like attempting to scroll down to the bottom in a GitHub Gist code editor widget.

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

5 participants