0

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?

2 Answers 2

3

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()

Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.