Skip to content

Instantly share code, notes, and snippets.

@luckycdev
Created April 28, 2022 18:02
Show Gist options
  • Save luckycdev/59059d5fa612d33274583fde3ae7671c to your computer and use it in GitHub Desktop.
Save luckycdev/59059d5fa612d33274583fde3ae7671c to your computer and use it in GitHub Desktop.
bookmarklet to search google images with a keyword

Code:

javascript:
var a="https://www.google.com/search?q=";
var b=prompt("What would you like to search in images for?", "pewdiepie");
var c="&tbm=vid";
if(b==="")
{
alert("invalid response");
}
else if(b===" ")
{
alert("invalid response");
}
else if(b!=null)
{
open(a+b+c);
}

Bookmarklet:

javascript:var a="https://www.google.com/search?q=";var b=prompt("What would you like to search in images for?", "pewdiepie");var c="&tbm=vid";if(b===""){alert("invalid response");}else if(b===" "){alert("invalid response");}else if(b!=null){open(a+b+c);}
javascript:var a="https://www.google.com/search?q=";var b=prompt("What would you like to search in images for?", "pewdiepie");var c="&tbm=vid";if(b===""){alert("invalid response");}else if(b===" "){alert("invalid response");}else if(b!=null){open(a+b+c);}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment