1

I spent hundreds of hours writing an HTML5 application.
This application deals with multiple popups and I suddenly ran into a problem when managing them.

My main goal would be bring a blurred popup window to front by focusing it.
I am wondering if this is possible in JavaScript.

If not, could I use java applet in order to gain more functionality on my popup windows.
Could I perhaps embed Google V8’s engine in order to render my existing HTML5 code in this application?

Andrew Thompson
169k42 gold badges224 silver badges441 bronze badges
asked Jan 2, 2012 at 0:42
3
  • 1
    What do you mean by "popup"? A new browser window? An alert()? Some framework's Popup widget? Commented Jan 2, 2012 at 0:49
  • Are the popups in different tabs? Commented Jan 2, 2012 at 0:51
  • HTML5 Application that uses window.open? Really? Commented Jan 2, 2012 at 1:25

1 Answer 1

1

when you open a window you create a reference to it. You can then use that reference to call focus() on.

var foo = window.open( /*params*/ );
foo.focus();
answered Jan 2, 2012 at 0:45
Sign up to request clarification or add additional context in comments.

4 Comments

I tried this many times, modern browsers like Google Chrome and Firefox doesn’t seem to support this feature anymore.
Yeah, modern browsers have a setting which usually disables site's control on window focus by default. It is deliberately so.
w3.org/TR/html5/browsers.html according to this, Window still has a focus() method. Not sure what exactly you're doing, but this should work.
I found the solution. In order to bring popup window to front, it has to be done on a user click event.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.