Skip to content

Instantly share code, notes, and snippets.

@rdev5
Last active April 26, 2016 20:07
Show Gist options
  • Save rdev5/9fc590e3dddd385ecfac855b172a18f1 to your computer and use it in GitHub Desktop.
Save rdev5/9fc590e3dddd385ecfac855b172a18f1 to your computer and use it in GitHub Desktop.
/*
* Usage:
* document.location = 'chrome://history-frame/';
* clearResults('Gmail'); // rinse and repeat
*/
var purgeResults=function(){document.getElementById("remove-selected").disabled=!1;for(var e=document.getElementsByTagName("input"),t=0;t<e.length;++t)"checkbox"==e[t].type&&(e[t].checked=!0);document.getElementById("remove-selected").disabled=!1,document.getElementById("remove-selected").click(),document.getElementById("alertOverlayOk").click()};
var clearResults=function(e){document.getElementById("search-field").value=e,document.getElementById("search-button").click(); setTimeout(function() { purgeResults(); }, 1000);};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment