469,313 Members | 2,671 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,313 developers. It's quick & easy.

Popups being blocked

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.

Mar 3 '07 #1
4 3050
On 3 mar, 03:57, "dd" <dd4...@gmail.comwrote:
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)

Mar 5 '07 #2
dd
On Mar 5, 1:31 am, "Seth Illgard" wrote:
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 :)

Mar 5 '07 #3
ASM
dd a écrit :
On Mar 5, 1:31 am, "Seth Illgard" wrote:
>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.
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,scroll bars=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
</a>

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 ?

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Mar 5 '07 #4
dd
On Mar 5, 11:15 am, ASM <stephanemoriaux.NoAd...@wanadoo.fr.invalid>
wrote:
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,scroll bars=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
</a>
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 ?
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.

Mar 6 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

52 posts views Thread by Harlan Messinger | last post: by
1 post views Thread by Jim Mitchell | last post: by
2 posts views Thread by Robert Oschler | last post: by
2 posts views Thread by Tom Szabo | last post: by
6 posts views Thread by Keith Smith | last post: by
7 posts views Thread by Nigel Molesworth | last post: by
reply views Thread by heathy | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.