patternjavascriptCritical
Open a URL in a new tab (and not a new window)
Viewed 0 times
urlandtabopennotwindownew
Problem
I'm trying to open a URL in a new tab, as opposed to a popup window.
I've seen related questions where the responses would look something like:
But none of them worked for me, the browser still tried to open a popup window.
I've seen related questions where the responses would look something like:
window.open(url,'_blank');
window.open(url);But none of them worked for me, the browser still tried to open a popup window.
Solution
Nothing an author can do can choose to open in a new tab instead of a new window; it is a user preference. (Note that the default user preference in most browsers is for new tabs, so a trivial test on a browser where that preference hasn't been changed will not demonstrate this.)
CSS3 proposed target-new, but the specification was abandoned.
The reverse is not true; by specifying certain window features for the window in the third argument of
CSS3 proposed target-new, but the specification was abandoned.
The reverse is not true; by specifying certain window features for the window in the third argument of
window.open(), you can trigger a new window when the preference is for tabs.Context
Stack Overflow Q#4907843, score: 1145
Revisions (0)
No revisions yet.