aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes How to Disable popup blocker using JavaScript? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to Disable popup blocker using JavaScript?" Watch "How to Disable popup blocker using JavaScript?" New topic
Author

How to Disable popup blocker using JavaScript?

Sirish Kumar Gongal Reddy
Ranch Hand

Joined: Oct 25, 2004
Posts: 109
Hello,

I need to check for the popup blocker status if popup blocker is enabled I need to disable that until I am using my application. how can i do this using javascript?

I need to do this with javascript only. Is't possible to put popup blocker in the enable mode before existing my application..?

Thanks in advance!

Regards,
Sirish
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Okay if you were able to disable a pop up blocker with JavaScript, than what would be the purpose of having it in the first place?

It is there to stop them and you can not turn it off. Best you can do is:

winpop = window.open("asdf.html");
if(!winpop || winpop.closed)alert("foobar");

Eric
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

I guess another question might be why you need it disabled. Maybe there is a better approach to your problem that you are missing. If you describe what you are doing maybe we can help come up with something good where the popup blocker is not an issue.


GenRocket - Experts at Building Test Data
Sirish Kumar Gongal Reddy
Ranch Hand

Joined: Oct 25, 2004
Posts: 109
Hi Gregg/Eric,

First and foremost thanks for your quick reply!

Why I insist to disable popup blocker is my application is having lot's of popup window every time my application tries to open a pop up window popup blocker is blocking that. So What i thought is, it is better to disable pop up blocker as long as I am in my application.

What do you guys think, is it feasible solution or is there any other best approch. Please narrate few lines about this problme.

Many thanks,
Sirish
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
There is nothing you can do as a coding standpoint to get around the pop up blocker. Best thing you can do is test to see if the window is open after you do it. I put the code in my previous post. If this is a corporate application, get your compamy to include your website in the safe list when they do the builds.

Personally I will never use a pop up window again because of iframes and Ajax.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to Disable popup blocker using JavaScript?