Skip to content

Instantly share code, notes, and snippets.

@murielsilveira
Last active March 10, 2016 19:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save murielsilveira/d7cbff99a3f2d8706e54 to your computer and use it in GitHub Desktop.
Save murielsilveira/d7cbff99a3f2d8706e54 to your computer and use it in GitHub Desktop.
GitHub diff with whitespace ignored
javascript:(function(){
if (document.location.host === 'github.com') {
var query = document.location.search;
if (query === '') {
document.location = document.location + '?w=1';
} else if (query.indexOf('w=') === -1){
document.location = document.location + '&w=1';
} else {
var index = query.indexOf('w=');
var arr = query.substr(index).split('&');
arr[0] = 'w=1';
var newQuery = query.slice(0,index) + arr.join('&');
var newUrl = document.location.origin + document.location.pathname + newQuery;
document.location = newUrl;
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment