Command-click doesn't open a new tab, but middle-click does

前端 未结 3 2005
眼角桃花
眼角桃花 2021-02-03 23:42

On my website, which is a one-page JS site using Sammy.js and jQuery, when I middle-click a link with a mouse, the link opens in a new tab. But when I command-click on a Mac, it

3条回答
  •  故里飘歌
    2021-02-04 00:13

    There is some interesting insight here: https://groups.google.com/forum/#!msg/mozilla.dev.usability/H1qLTur4EFc/gXH007CAPk8J

    Apparently the JS you are using can preventDefault() the cmd+click while the middle-click is unaffected. Consult the docs of your JS/Site framework.

提交回复
热议问题