0

When I try to open a new window using:

window.open('url?params','_blank')

it's treated as a popup.

Tried with this to:

<a hred='url?params' target='_blank'>Test</a>

same result.

Tested it on Chrome and Edge.

My site isn't marked as "Secure" in the browser. Does it have to be marked as Secure (HTTPS), to be able to open new windows?

gre_gor
  • 6,669
  • 9
  • 47
  • 52
Balan Narcis
  • 139
  • 1
  • 10
  • You want a new tab or window? Shouldnt matter, you should be able to open a new window with the target of blank. – TGarrett Jul 13 '17 at 16:56
  • I can't, it's treated as a pop up. – Balan Narcis Jul 13 '17 at 16:59
  • I think `window.open` and `target='_blank'` _should_ do the same thing. If the settings for the browser are set to open a new window, that link would open a new window. However, I think most modern browsers default to a new tab rather than window. New windows are often considered popups by default, and would also be a setting for the browser, or controlled by a popup blocker. – Apolymoxic Jul 13 '17 at 17:02

1 Answers1

1

The problem is not with your site being Secure or not.

The thing here is with browsers. They are designed to block new tab or new window as pop ups if they have not being effected/caused form a trusted event. That means the user has to actively click somewhere to open a popup or some submission has to happen to allow the pop up.

The answers from here and here should give you better insights.

pro_cheats
  • 1,534
  • 1
  • 15
  • 25