javascript - window.blur() not working with Firefox 4 - Stack Overflow

I have a function that when activated opens a new window as a pop-under under the current browser windo

I have a function that when activated opens a new window as a pop-under under the current browser window. It was working fine with all past version of IE and FF, now it has stopped working. Apparently Mozilla has changed one of the setting of FF 4 to prevent this:

Here is the code I am using:

function popup(page) {
    var myWin = window.open(page,"mywindow","menubar=1,resizable=1,status=1,toolbar=1,location=1,directories=1,scrollbars=1");
    opener = myWin.blur();
}

How can I get this code to work on FF 4?

I have a function that when activated opens a new window as a pop-under under the current browser window. It was working fine with all past version of IE and FF, now it has stopped working. Apparently Mozilla has changed one of the setting of FF 4 to prevent this: http://support.mozilla./en-US/questions/806756

Here is the code I am using:

function popup(page) {
    var myWin = window.open(page,"mywindow","menubar=1,resizable=1,status=1,toolbar=1,location=1,directories=1,scrollbars=1");
    opener = myWin.blur();
}

How can I get this code to work on FF 4?

Share Improve this question edited Nov 5, 2015 at 22:29 Anders 8,65310 gold badges60 silver badges99 bronze badges asked Jun 19, 2011 at 1:59 PaperChasePaperChase 1,5854 gold badges18 silver badges23 bronze badges 5
  • 3 "I have a function that when activated opens a new window as a pop-under under the current browser window" - you wouldn't happen to work for Netflix, would you? – kinakuta Commented Jun 19, 2011 at 2:03
  • lol, I was just trying to find a solution for this at work Friday. Doesn't even work if you run the code on setTimeout() – Alex Commented Jun 19, 2011 at 2:04
  • No, I don't work for Netflix. I run my own coupon code site. When the user clicks to copy the code it activates this function to open the retailer site in the background. – PaperChase Commented Jun 19, 2011 at 2:05
  • setTimeout(function(){ window.focus(); }, 200); doesn't work, as I thought it may have been a timing issue... – Alex Commented Jun 19, 2011 at 2:07
  • I have noticed this behavior change with Netflix ads lately in FF (was just kidding, PaperChase - I immediately think of Netflix whenever I see "popunder") – kinakuta Commented Jun 19, 2011 at 2:12
Add a ment  | 

2 Answers 2

Reset to default 4

Doesn't look like you have control over this behavior...

http://support.mozilla./en-US/questions/806756#answer-167267

It seems to work if you make the popup create another child window, close it, then blur the popup window. Like so:

var win = window.open(...);
win.window.open('about:blank').close();
win.blur();
window.focus();

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745632420a4637188.html

相关推荐

  • javascript - window.blur() not working with Firefox 4 - Stack Overflow

    I have a function that when activated opens a new window as a pop-under under the current browser windo

    5小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信