I tried for months to build this myself before asking but at this stage I'm forced to accept that I will only ever be the worst kind of code-stealing script-kiddie and am terrible at javascript.
Confession over, I need a single bookmarklet that when run, will get 1 variable from the URL (i.e. q=2075083, ALWAYS a 7 digit number, q will always be the id), open 2 new tabs, each one using the variable grabbed to perform a custom search in each of the other two tabs.
There's only one more caveat - I will need to add more search tabs in the future :/
And I'm LOST trying to make it myself. Can anyone lend their expertise or advice?
This is an operation I perform hundreds of times a day, and it would significantly reduce the amount of mouse clicks and copy-paste operations I'll do.
Thank you dearly to anyone who can help or advise.
P.S. I've gotten as far as the code below (which I'll make in to a bookmarklet at a later stage).
function getQueryVariable(variable)
{
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if(pair[0] == variable){return pair[1];}
}
return(false);
}
Calling getQueryVariable("q") returns the number I need, but I've no idea how to put it to use creating the two other tabs searching for it.