Reputation: 1593
We've recently put a change into our application that will stop forcing the opening of new windows when opening new pages. In most default setups this causes these pages to be opened as new tabs, but I realize this may be user dependent.
However, we've noticed some strange behaviour in chrome where the same call to:
window.open('http://google.ca');
will sometimes open in a tab and sometimes open in a new window. It appears to have something to do with a delay in the processing of the javascript, but I am not really sure.
The following JSFiddle has instructions for reproduction of the behaviour. Can anyone explain this behaviour or provide a means to use a single window.open call that will open consistently in the same way when a left click is used?
Upvotes: 0
Views: 556
Reputation: 8795
You can see a detailed response here; the gist is if it's a user initiated behavior, it will open in a new tab. If there is a delay of any sort, such as a timeout, then it will open in a new window. So your observations regarding the delay in processing are correct.
This may be a UI or workflow issue if your calls to window.open
are sometimes delayed. Some of the other answers provided in the thread linked to may provide you with options.
Upvotes: 1