6

A project I'm working on requires that we create a pop up window and then change focus back to the parent window. Many solutions that seem to have worked in the past seem to not work at all in many new versions of Chrome, Firefox, and Safari and IOS 8 Safari. For example this W3C demo http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_win_blur does not work in those browsers but does work properly in IE10 and below.

It seems as though browsers might have started deprecating this feature but I've seen no documentation about it. Could anyone point me to an alternative to window.focus() and window.blur() that will work on IOS 8 Safari or at least some documentation about the methods being deprecated?

----- To elaborate a bit more for my colleague ----- Mike LP

The situation is as such:

We have a web application that requires the explicit use of a popup window. Overlays and iframes are an option due to some technical constraints.

While not desirable, it is okay that the newly created popup window receives focus upon opening, but we have a button on the popup that when clicked should return focus to the parent window, while leaving the popup open.

We've been unable to accomplish this using any of the modern browsers, though we do have a solution that works on iOS 7 Safari. Unfortunately even that appears to no longer work on iOS 8.

Mike LP
  • 671
  • 8
  • 13
  • 5
    It's not deprecated per se, but browsers today try to block "pop-unders" as it's only real use is annoyning ads and malware. – adeneo Feb 18 '15 at 18:05
  • 2
    Why use a pop up at all in modern web pages? – epascarello Feb 18 '15 at 18:10
  • Recently, I've seen websites do this on iOS8 Safari by: 1-opening a new window with the same content as the first one (gets focus); 2-replacing the first window's content with an ad (blurred). This gives a similar effect to what you are describing. – blex Feb 18 '15 at 18:20

0 Answers0