Guest User

Untitled

a guest
Jul 20th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. // title : Clear Highlight for Google Cache
  2. // description :
  3. // uuid : 2b5baf09-434f-4036-9e4f-022476094531
  4.  
  5. //bookmarklet
  6. /*
  7. javascript:(function(){if(window.location.hostname.indexOf("webcache.googleusercontent.com")===0){var a=window.location,b=encodeURI(decodeURI(a.href)),c=encodeURI(decodeURI(a.search)).split("&"),d=c[0].indexOf("+");if(d!==-1){var e=c[0].slice(0,d);b=b.replace(c[0],e);a.assign(b)}};})();
  8. */
  9.  
  10.  
  11. //main
  12. (function(){
  13. if(window.location.hostname.indexOf('webcache.googleusercontent.com') !== 0) return;
  14.  
  15. var l = window.location;
  16.  
  17. var strUrl = encodeURI(decodeURI(l.href));
  18. var lstQuery = encodeURI(decodeURI(l.search)).split('&');
  19. var intIndexAND = lstQuery[0].indexOf('+');
  20. if(intIndexAND === -1) return;
  21.  
  22. var strMinSearch = lstQuery[0].slice(0, intIndexAND);
  23. strUrl = strUrl.replace(lstQuery[0], strMinSearch);
  24.  
  25. //console.log(strUrl);
  26. l.assign(strUrl);
  27. })();
Add Comment
Please, Sign In to add comment