Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to turn off animations in github while viewing navigating through code?

Tags:

github

Is there a way to turn off animations in github while viewing navigating through code? For example, if you click on a directory there is a javascript animation as it changes to present the list of the new directory's contents. It drives me nuts, so I'd like to be turn it off. I can't find anything in the github settings.

like image 218
Adrian Scott Avatar asked Jul 02 '12 16:07

Adrian Scott


2 Answers

When on github page, type this into your url bar:

javascript:(function(){jQuery.fx.off=true;})();

You can also create a bookmarklet to avoid pasting it all the time.

like image 94
ivan Avatar answered Sep 21 '22 20:09

ivan


If your browser supports extensions, it should be easy to create one that disables jQuery FX on all GitHub pages. The following worked for me when used as an "End Script" in Safari:

var killFX = document.createElement("script");
killFX.text = "jQuery.fx.off=true;";
document.body.appendChild(killFX);

Update 10/04/13: GitHub has added or changed the Content-Security-Policy header to disallow inline JavaScript:

X-WebKit-CSP : default-src *; script-src https://github.com https://a248.e.akamai.net https://jobs.github.com https://ssl.google-analytics.com https://secure.gaug.es https://gist.github.com; style-src https://github.com https://a248.e.akamai.net https://jobs.github.com https://ssl.google-analytics.com https://secure.gaug.es https://gist.github.com 'unsafe-inline'; object-src https://github.com https://a248.e.akamai.net

…which breaks the Safari extension:

Refused to execute inline script because of Content-Security-Policy.

Investigating.

like image 32
Ryder Mackay Avatar answered Sep 18 '22 20:09

Ryder Mackay