Skip to content

Instantly share code, notes, and snippets.

@aont
Last active July 13, 2023 07:20
Show Gist options
  • Select an option

  • Save aont/7b7b3b86f4db7a9b27df to your computer and use it in GitHub Desktop.

Select an option

Save aont/7b7b3b86f4db7a9b27df to your computer and use it in GitHub Desktop.
ReGoogle
(function () {
var url = new URL(location);
var searchParams = url.searchParams;
var q = searchParams.get("q");
var promptResult = prompt("regoogle", q);
if(promptResult&&promptResult!=q) {
searchParams.set("q", promptResult);
url.search = searchParams.toString();
location.href = url.href;
}
})();
!function(){var o=new URL(location),n=o.searchParams,t=n.get("q"),a=prompt("regoogle",t);a&&a!=t&&(n.set("q",a),o.search=n.toString(),location.href=o.href)}();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment