Skip to content

Instantly share code, notes, and snippets.

@sohjsolwin
Created July 14, 2017 15:36
Show Gist options
  • Save sohjsolwin/f70b2be28f3eef960608cf3f74297c6d to your computer and use it in GitHub Desktop.
Save sohjsolwin/f70b2be28f3eef960608cf3f74297c6d to your computer and use it in GitHub Desktop.
Javascript Snippets
javascript:(function() {var varchar = '?'; if (location.href.indexOf("?") > 0) {varchar='&'} location.href = location.href + varchar +'rand=' + new Date().getTime().toString(16);}())
javascript:(function(){var url=location.href;var ampIndex='';var omIndex='';if(url.indexOf('?')==-1){url=url+'?om=1';}else{ampIndex=url.indexOf('&');omIndex=url.indexOf('?om=');if(omIndex>-1&&ampIndex>-1){url=url.replace('om=1&','').replace('om=0&','');}else if(omIndex>-1){url=url.substring(0,omIndex);}else{omIndex=url.indexOf('&om=');if(omIndex>-1){url=url.replace('&om=1','').replace('&om=0','');}else{omIndex=url.indexOf('?overrideminimize=');if(omIndex>-1&&ampIndex>-1){url=url.replace('overrideminimize=1&','').replace('overrideminimize=0&','');}else if(omIndex>-1){newUrl=url.substring(0,omIndex);}else{omIndex=url.indexOf('&overrideminimize=');if(omIndex>-1){url=url.replace('&overrideminimize=1','').replace('&overrideminimize=0','');}else{url=url+'&om=1';}}}}}location.href=url;})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment