Code:
javascript:
var a="https://www.reddit.com/search/?q=";
var b=prompt("What would you like to search on Reddit?");
if (b==="")
{
alert("invalid response");
}
else if (b!=null)
{
var c=confirm("Would you like to search specifically in subreddits or users?\nCancel for general search, OK for yes");
if (c==true)
{
var d=confirm("Cancel for users search, OK for subreddits search");
if (d==true)
{
open(a+encodeURI(b)+"&type=sr");
}
else
{
open(a+encodeURI(b)+"&type=user");
}
}
else
{
open(a+encodeURI(b));
}
}
Bookmarklet:
javascript:var a="https://www.reddit.com/search/?q="; var b=prompt("What would you like to search on Reddit?"); if (b==="") {alert("invalid response");} else if (b!=null) {var c=confirm("Would you like to search specifically in subreddits or users?\nCancel for general search, OK for yes"); if (c==true) {var d=confirm("Cancel for users search, OK for subreddits search");if (d==true) {open(a+encodeURI(b)+"&type=sr");} else {open(a+encodeURI(b)+"&type=user");}} else {open(a+encodeURI(b));}}
General Search only:
javascript:
var a="https://www.reddit.com/search/?q=";
var b=prompt("What would you like to search on Reddit?");
if (b==="")
{
alert("invalid response");
}
else if (b!=null)
{
open(a+encodeURI(b));
}
General Search only Bookmarklet:
javascript:var a="https://www.reddit.com/search/?q=";var b=prompt("What would you like to search on Reddit?");if (b===""){alert("invalid response");}else if (b!=null){open(a+encodeURI(b));}