Explosion Pills
Explosion Pills

Reputation: 191729

JavaScript: open window with browser

I'd like to be able to open another window for a user and use the URL bar as if the user had used it. This doesn't seem possible, but I might as well ask.

Basically I want to emulate the behavior of opening a new tab/window, typing some non-URL in, and having your browser behave accordingly (typically it will use your default search engine).

Can this be done with JavaScript?

Upvotes: 0

Views: 260

Answers (2)

Ranganadh Paramkusam
Ranganadh Paramkusam

Reputation: 4358

In address bar, you can enter like this to open new window

javascript:window.open();

clear the text in address bar and try this, it'll open new tab

javascript:showModalDialog("#","","")

This also will work fine, if you want to open same link in new window

Upvotes: 0

ThiefMaster
ThiefMaster

Reputation: 318468

No, that's not possible.

What browsers do when typing a non-url in the address bar cannot be emulated e.g. using window.open()

Upvotes: 3

Related Questions