Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8004023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:48:25+00:00 2026-06-04T16:48:25+00:00

On my website, which is a one-page JS site using Sammy.js and jQuery, when

  • 0

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 doesn’t. This happens in both Firefox and Chrome, so I assume it must be according to spec in some way.

This happens on a Macbook Air (so trackpad + command button). Most sites work just fine though, with command-click being identical to normal middle-click.

Try it out yourself: https://circleci.com. Command-click between “about”, “home” and “contact” and you should experience the problem – they don’t open in new tabs.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T16:48:26+00:00Added an answer on June 4, 2026 at 4:48 pm

    Speculating here, but will confirm later from a Mac. This has been confirmed to be working on a Mac.

    Win ctrl+click or a Mac command+click gets picked up by a “normal” click listener, just like a click with any other modifier key (alt+click, shift+click etc).

    This is particularly confusing since a ctrl+click on a Mac gets interpreted as a right-click on OS level. Command-click, on the other hand, is not interpreted as a middle-click but rather is a browser preference.

    Assuming that you do not have in-site functionality that specifically relies on modified clicks, it would be appropriate to exclude such events from click listeners, and instead allow for them to bubble up to be natively handled by the browser. Given the experience of someone in the similar situation, you should be able to add the following to click handlers (likely a delegate on library level as pointed out by Brilliand):

    if (e.metaKey || e.ctrlKey) return;
    

    When added at the beginning of the handler with e referring to a current click event, this should circumvent any following e.preventDefault();

    Update:

    It actually works! In this rather minimalistic fiddle, I am able to recognize when command-clicked or control-clicked, so as to avoid executing the rest of the click handler which includes ajax-fetching the content and e.preventDefault();. This allows for a command-click to be handled “as intended” on a Mac, i.e. opening the link in a new tab.

    With this finding in mind, these lines should now read

    if (e.isDefaultPrevented() || e.metaKey || e.ctrlKey) {
        return;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one master page which applies to all pages in this website. On
I am working on one real estate website which is Using RETS service to
I have a one-page website with sliding panels, some of which have external links.
I have a link on a page which generates a pdf. I am using
I am currently building a website in codeigniter that is one page site, basically
Is it advisable to implement url routing for an asp.net(webforms) website which is one
I have a website which hangs about 20 times a day for between one
One of my friend wants to have a website which calculates the distance between
Didn't find any from their website. I mostly just trying to see which one
Our website has one section which often changes to match the user. (examples are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.