bookmarklet for a random link in a new tab
-
In Firefox, how can I get my bookmarklet to open a link in a new tab? I'm looking for a bookmarklet that will open a random link on the current page, in a new tab. I found a couple of random link openers: javascript:void(window.open(document.links[Math.floor(Math.random()*document.links.length)].href,'_self')); javascript:void(location.href=document.links[Math.floor((document.links.length)*Math.random())]) but both of them just open the link in the same tab I'm in. Is there a way to modify either of these to open new tabs, or, alternatively, some other one-click way to open a randomly selected link?
-
Answer:
take the '_self' bit off the first one, or change it to a different name. _self refers to the current window anything else (except '_parent' or '_top' which also do special things), or nothing, will mean it opens in a new window.
maqsarian at Ask.Metafilter.Com Visit the source
Other answers
you want '_blank' instead of '_self' in the first one.
jedrek
In the second one, change "void(location.href=blah)" to "void(window.open(blah,'_blank'))".
mbrubeck
Sweet. Thanks!
maqsarian
Middle-clicking on a three button mouse opens bookmarks and normal links in a new tab. On my 2-button laptop, chording the buttons (pushing and releasing both buttons together) is interpreted as a middle button press and does the same thing.
NortonDC
Yes. Middle-clicking on a bookmarklet, though, just opens a new tab to javascript:whatever.
maqsarian
Related Q & A:
- How to programmatically open a new tab on Safari iPad?Best solution by whoknew.dk
- Why isn't a new tab opened any longer?Best solution by Ask.Metafilter.Com
- Can I open my bookmarks in a new tab when I am in my yahoo?Best solution by answers.yahoo.com
- How can I add a clickable link to a question or answer on yahoo?Best solution by Yahoo! Answers
- How easy is it to get a grant for a down payment on a new home?Best solution by eHow old
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.