Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I open multiple links using a hotkey?

I want to open multiple links using a hotkey on a web page. For this I am using accesskey for hotkey mapping and the following code.

<a href="https://link1"
   onclick="window.open('link2'); window.open('link3'); return true;"
   accesskey="1">Some text</a>

The onclick event will not acknowledge when the element is accessed using accesskey (but tab to select and enter works). Is there another DOM event, or method which can accomplish the function of hotkey = 'open_multiple_windows'?

I have tried to use onsubmit, onchange, oninput, onselect and onopen.

like image 984
redteamwynns Avatar asked Jun 27 '16 06:06

redteamwynns


People also ask

Is there a way to open multiple links at once in Chrome?

To do this, you'll need to hold down the right mouse button, then draw a box around the links you want opened. A tiny number appears on the bottom right corner of the selection box to indicate how many links will be opened. As soon as you release the mouse button, all selected links will open at the same time.

How do I open multiple tabs with my keyboard?

Or, use a keyboard shortcut: Windows & Linux: Ctrl + t. Mac: ⌘ + t.


1 Answers

<a href="#" onclick="window.open('https://google.com','_blank'); window.open('https://bing.com','_blank');" accesskey=1></a>

This code should work BUT multiple pages could be blocked (as a popup)

like image 104
Roxoradev Avatar answered Oct 21 '22 23:10

Roxoradev