Forum Moderators: open

Message Too Old, No Replies

Toolbar blocks legitimate popups

well, IMHO. ondblclick

         

RonPK

7:33 am on Aug 31, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The Google Toolbar is blocking popups that get triggered by the ondblclick event. Brief code example:

<p ondblclick="window.open('','','width=300,height=300')">click me twice</p>

I'm trying very hard to think of a sensible reason for this, but haven't come up with anything.

I've been mailing about this with toolbar-support. Their last message explained how to turn off the popup blocker for specific sites and how to prevent IE from reporting js errors - as if I wouldn't know that.

Anyone got a clue why popups triggered by ondblclick should be blocked? Or is this simply a design error?

Lord Majestic

8:34 am on Aug 31, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Or is this simply a design error?

IMHO that or possibly they tried to make "the best popup blocker", blocking everything. USP so to speak.

RonPK

9:00 am on Sep 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yeah, it may be just a bit too restrictive. I think hardly anybody ever double-clicks on plain text (I've seen people doing it on links). After all, it only selects the word - an action for which most users simply drag the mouse over the text.

I'm using the ondblclick event to open a popup that contains a site search form. The word the user double-clicked on automagically gets filled into the search field. Isn't that nice and easy. I guess I'll have to ask folks to have their toolbar permit popups on my site.

Lord Majestic

9:02 am on Sep 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How about this - your code that opens popup will then try to access that opened window and if it fails then you'd know popup was either blocked or closed by user (should not be). If window is not there then you will get JavaScript exception, I think there is a way to intercept it and handle, perhaps using "eval"?

Alternatively popup itself will access the main window and set some variable 'PopupOpened' (defaulted to false) to true, then using timer you check that variable X seconds later and if its still false then popup probably failed.

RonPK

10:57 am on Sep 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here's what I've got now (pseudo-code):

var mywin = window.open('', '', parameters); 
if (mywin) {
// do my stuff, write lines into the new window
} else {
alert('Please have your popup-blocker allow popups from this site');
}

More or less similar to what you suggested.