Popups being blocked

D

dd

I have a scenario where my popups are being blocked
by IE6+ and Firefox. The problem is that although the
popup is a direct result of the user clicking on the link
(meaning that they WANT the popup), when it comes
to opening it, I'm doing it via a JavaScript function and
by the time the popup is opened the browser doesn't
know it was as a result of that click. The link between
click and popup open attempt is broken. The reason
for this is that the click occurs in Flash, and to open
the popup it makes a call out to my JavaScript. The
solution of course is that the Flash itself opens the
popup and that works. We'd prefer it though if the
JavaScript function could open it because it has more
logic in it and does other stuff.

I've noticed a few sites that somehow managed to
get around this problem though. When I looked at
the code they're using to open the popup it just looks
completely standard, like this:

var pop=window.open(url,name,options);
if(pop)pop.focus();

Here's a site that's managing to launch a popup that
isn't from a click:

http://www.peekvid.com/tv.html

In IE6 (with SP2) I see the popup warning bar at the
top of the client area ("popup blocked"), but despite
that, the popup opens anyway (or a second one
manages to open). In Firefox it seems like it gets
blocked, but when you close the browser, the
unload event manages to spawn a popup anyway.

I looked at their code and saw only the code above
along with a lot of obfuscated code that is very hard
to figure out.
 
S

Seth Illgard

I have a scenario where my popups are being blocked
by IE6+ and Firefox. The problem is that although the
popup is a direct result of the user clicking on the link
(meaning that they WANT the popup), when it comes
to opening it, I'm doing it via a JavaScript function and
by the time the popup is opened the browser doesn't
know it was as a result of that click. The link between
click and popup open attempt is broken. The reason
for this is that the click occurs in Flash, and to open
the popup it makes a call out to my JavaScript. The
solution of course is that the Flash itself opens the
popup and that works. We'd prefer it though if the
JavaScript function could open it because it has more
logic in it and does other stuff.

I've noticed a few sites that somehow managed to
get around this problem though. When I looked at
the code they're using to open the popup it just looks
completely standard, like this:

var pop=window.open(url,name,options);
if(pop)pop.focus();

Here's a site that's managing to launch a popup that
isn't from a click:

http://www.peekvid.com/tv.html

In IE6 (with SP2) I see the popup warning bar at the
top of the client area ("popup blocked"), but despite
that, the popup opens anyway (or a second one
manages to open). In Firefox it seems like it gets
blocked, but when you close the browser, the
unload event manages to spawn a popup anyway.

I looked at their code and saw only the code above
along with a lot of obfuscated code that is very hard
to figure out.

You can use a random name fo the popups so the browser doesnt think
you are using the same popup over and over. Also, we all hate popups,
use popunders insted (absolutly positioned divs that "float" over the
page)
 
D

dd

You can use a random name fo the popups so
the browser doesnt think you are using the
same popup over and over.

The name is effectively random already. I'm
not using the same popup over and over.
There's just one popup.
Also, we all hate popups

It's not popups you hate exactly. It's those
UNWANTED popups you really hate. What I'm
trying to popup is just a new window with
the content that the user requested. It just
so happens that this is also classed as a
popup. The problem is that the browser can't
determine that the user wanted this new window
because the connection with the click they
just did was lost, so now it seems to the
browser like this is an unsolicited popup.

use popunders insted (absolutly positioned
divs that "float" over the page)

I already offer the option of using a floating
div pseudo popup. It's for the people that
don't want to use them, and instead use a new
window that I'm looking for this solution.

FYI - that's not what a popunder is. A pop
under is a popup that auto-blurs itself so
that it's hiding behind your browser window :)
 
A

ASM

dd a écrit :
The name is effectively random already. I'm
not using the same popup over and over.
There's just one popup.

tell me the difference between both ... ! ?
What I'm
trying to popup is just a new window with
the content that the user requested. It just
so happens that this is also classed as a
popup. The problem is that the browser can't
determine that the user wanted this new window
because the connection with the click they
just did was lost, so now it seems to the
browser like this is an unsolicited popup.

User can decide to open the popup in a tab
In this case the tab reacts exactly as a popup.
(so do no give a size to the popup)

To use same popup I think you have to do :

function pop(page) {
if(typeof(truc) == 'undefined' ||
!truc ||
truc.closed)
truc = window.open('','truc','menubar=0,location=0,scrollbars=1');
truc.location = page;
truc.focus();
}

While popup isn't closed
the file called is displayed in this window(or tab)
and popup/poptab comes on front
If popup is closed a new popup with same name is oppened.

<a ref="page1.htm" onclick="pop(this.href); return false;">
page 1
I already offer the option of using a floating
div pseudo popup. It's for the people that
don't want to use them, and instead use a new
window that I'm looking for this solution.

They can click something to give their choice ?
 
D

dd

User can decide to open the popup in a tab
In this case the tab reacts exactly as a popup.
(so do no give a size to the popup)

To use same popup I think you have to do :

function pop(page) {
if(typeof(truc) == 'undefined' ||
!truc ||
truc.closed)
truc = window.open('','truc','menubar=0,location=0,scrollbars=1');
truc.location = page;
truc.focus();

}

While popup isn't closed
the file called is displayed in this window(or tab)
and popup/poptab comes on front
If popup is closed a new popup with same name is oppened.

<a ref="page1.htm" onclick="pop(this.href); return false;">
page 1


They can click something to give their choice ?

I'm not sure how we got into the issue of popup
name re-using. This isn't relevant to my problem.

I have a JS function in my library which looks
like this (in pseudo code form):

function linkclicked(params) {
if want to navigat in-page
self.location.href = newurl
else
{
popuphandle = window open (params)
if popuphandle indicates popup was blocked and want div
create a div with iframe with src set to newurl
else if in-page allowed on popup blocked
self.location.href = newurl
}
}

As you can see, sometimes the caller of this
function might want to navigate in-page. If
not then they want to open the link in a new
window. One of the parameters indicates whether
navigating to the link in an iframe on a div is
a valid alternative when the popup is blocked.

This function works well enough, I'm just trying
to see if there are any known ways to prevent
the popup being blocked.

The only reason the popup is blocked is because
the click that the user did was inside FLASH.
The Flash made a getURL or FSCommand out to the
JavaScript to tell it to navigate to the URL.

One workaround we have is to NOT make the call
out to the JS function. Instead we open the
popup window directly from inside the FLASH. The
drawback of that is that we lose the extra stuff
that the JS function does (with information that
the FLASH doesn't have access to easily).

Some sites manage to beat the popup blockers and
I'm really looking to find out how they're doing
it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top