Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save luckycdev/26ca83ec305727973bce24d1479fe7ef to your computer and use it in GitHub Desktop.
Save luckycdev/26ca83ec305727973bce24d1479fe7ef to your computer and use it in GitHub Desktop.
Search YouTube using a bookmarklet prompt

If you want to search youtube unblocked: https://gist.github.com/luckycdev/80371b23f06a16106eb4c5364ee04960

Code:

javascript:
var a="https://www.youtube.com/results?search_query=";
var b=prompt("What would you like to search on youtube?", "MrBeast");
if(b==="")
{
alert("invalid response");
}
else if (b===" ")
{
alert("invalid response");
}
else if(b!=null)
{
open(a+b);
}

Bookmarklet:

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