by KoenDG on 8/15/20, 5:53 PM with 10 comments
And as a result of that, 25 tabs get opened, that being all the links on the page.
That's my use case: I want to open up all the links, at the same time, each in their own tab, and I can just CTRL+TAB through them as I please.
I'm just asking here on the off-chance that it exists but I somehow could not find it. If it doesn't exist yet, I may well have to write it myself, which I frankly hope doesn't take too much effort. Let's hope there's some decent boilerplate for this, that can be easily found.
Thanks in advance for any help.
by neckardt on 8/15/20, 8:00 PM
1. Create a new bookmark to any page, name it whatever.
2. Right click the bookmark -> Properties
3. Replace the "Location" field with:
javascript:stories=document.getElementsByClassName("storylink");for(idx=0;idx<stories.length;idx++){ window.open(stories[idx].href)}
While on HN if you click the bookmarklet, it will open all of the links in a new tab.by brudgers on 8/15/20, 7:38 PM
Even with the delay one or two of the thirty requests would usually hit the rate limit, but this was faster than slowing the loop down with a larger delay in terms of how I used the script. It was kludge coded but good enough for my needs.
Note that “all the links” is not all the links. There are flag and vote and user account and site history and two discussion links for the typical front page story. Plus the header and footer links and the login or logged in links.
by gabrielsroka on 8/16/20, 12:21 AM
javascript:document.querySelectorAll('.storylink').forEach(s=>open(s.href)) //Open All HN
To install, select all the text (including the "//Open All HN" comment) and drag it to your bookmarks toolbar. The comment becomes the bookmark name in Chrome and it kinda works in Safari, but not in Firefox.Is anyone worried about opening 30 random-ish links? I wouldn't do it...
by scott31 on 8/15/20, 11:15 PM
by DonCopal on 8/15/20, 11:28 PM
by stevekemp on 8/15/20, 7:16 PM
Perhaps this is a good starting point:
by jituc on 8/16/20, 6:44 AM
by thanatos519 on 8/15/20, 5:56 PM
by KoenDG on 8/15/20, 9:24 PM