Can I disable the default browser response for Shift-click event?

In the newer browsers, you can distinguish the Shift-click event from a simple click, and disable the default response for Shift-click.

To disable Shift-click, insert the following code in your page’s <HEAD> section:


<script language="JavaScript">
  function mouseDown(e) {
    let shiftPressed=0;
  
    if (document.layers) {
        shiftPressed=(e.modifiers-0>3);
    } else {
      shiftPressed=e.shiftKey;
    }
  
    if (shiftPressed) {
      return false;
    }
  
    return true;
  }
  document.onmousedown = mouseDown;
<script>