Another triumph of the internets. Well for one thing. Stackoverflow.com never seems to fail me.
I was working on this project for almost a year and now I got back to it from solving other, more high priority and more complex issues (cookies?). So now I’m back here with my last and only issue, I was determined to put an end to my and its misery.
Lo and Behold. The popup blocker detector that worked for me (in IE8, Firefox 4, and Google Chrome 11.0
Modified from the lovely people’s answer here I present to you….
g33kp0st’s Cross Browser Pop-up Blocker
//Formatted for layout sake var myPopup = window.open("about:blank", "", "directories=no,height=150,width=150,menubar=no, resizable=no,scrollbars=no,status=no,titlebar=no,top=0,location=no"); if (!myPopup) alert("failed for most browsers"); else { setTimeout(function() { //Use to test for Google Chrome Pop-Up if (myPopup.screenX === 0) { alert("Google Chrome Pop-up blocker is detected."); } else { // close the test window if popups are allowed. alert('Pop-up blocker is detected.') myPopup.close(); } }, 0); }
Slap that onto a .js file and place onto web page needed and voila! It works for me. I had to take out the onload() function since it hangs IE to no end.
But what the hell it works! Goddamnit.
Now I celebrate by biting onto that heavenly,oh-so-deliciously good coffee brownie. Yum. Hope this helps alot of people out there.
Discussion
No comments yet.