Event when clicking to open page in a new tab

Posted 2 months ago by RoboRobok

Hi guys,

is there any JavaScript event fired when we open page in a new tab, like cmd+click on macOS? I'm pretty sure there's no event for that, but I think it would be extremely useful.

Many Single Page Apps don't behave correctly when using that feature. They will open the content in a new tab, but also change the content on the current tab. That's because they handle click event. For what I am aware of, some frameworks implement additional checking if a key is pressed, but it's pretty lame to assume the shortcut. Would be really cool if either of those were implemented:

  1. Additional data on click event, like: extra: "new_tab".
  2. Separate event for opening page in new tab/window, which I guess would be best if not fired when we right-click and select the option from the dropdown.

What do you guys think? And where would you send a proposal for that?

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.