Can the new tab be opened in the background in HTML Form target="_blank"?

386 Views Asked by At

Adding target="_blank" to form will post & open the result in a new tab (or window).

<form target="_blank" enctype="multipart/form-data" 
      action="https://www.example.com/" method="POST">
  <!-- more HTML -->
</form>

// and from the addon form.submit();
// there isn't any button or link to be clicked by the user

By default, the new tab will be the selected/foreground tab.
Is it possible to control/set the foreground/background status of the new tab?

N.B. The purpose is to give the USER the choice of opening in the foreground or background by using a modifier key (like for example shift or Ctrl).

The code is part of a Firefox addon (not part of site JavaScript).

0

There are 0 best solutions below