473,249 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,249 software developers and data experts.

Popup detection

Hi there all,

Is there a way, using Javascript, that you can detect if a popup window has
opened successfully?
I'm tring to work out if someone is running popup blocking software or not.

Cheers,

@ndyB
Jul 23 '05 #1
10 3145
On Thu, 6 May 2004 10:10:11 +0100, Agony.COM <in**@agony.com> wrote:
Is there a way, using Javascript, that you can detect if a popup window
has opened successfully?


Check the Google groups archive for partial solutions. This topic has been
discussed more than once, but I believe the basic answer is, no. At least
not with consistent results.

Mike

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 23 '05 #2
In article <40**********************@mercury.nildram.net>,
in**@agony.com enlightened us with...
Hi there all,

Is there a way, using Javascript, that you can detect if a popup window has
opened successfully?


Kinda sorta, but not really.
IOW, not reliably in all browsers.
--
--
~kaeli~
Press any key to continue or any other key to quit
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #3
Original page has the following function:

<script language="JavaScript">
var child=window.open("blah.html","nam","args")

function imHere(){
//if this function is called then the popup is opened
alert("YAY! no popup blocker for me, I'm free to annoy the world!")
}
</script>

child page (blah.html or whatever uses this for verification
<body onLoad="window.opener.imHere()">

"kaeli" <ti******@NOSPAM.comcast.net> wrote in message
news:MP************************@nntp.lucent.com...
In article <40**********************@mercury.nildram.net>,
in**@agony.com enlightened us with...
Hi there all,

Is there a way, using Javascript, that you can detect if a popup window has opened successfully?


Kinda sorta, but not really.
IOW, not reliably in all browsers.
--
--
~kaeli~
Press any key to continue or any other key to quit
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #4
Chris wrote:
Original page has the following function:

<script language="JavaScript">
var child=window.open("blah.html","nam","args")

function imHere(){
//if this function is called then the popup is opened
alert("YAY! no popup blocker for me, I'm free to annoy the world!")
}
</script>

child page (blah.html or whatever uses this for verification
<body onLoad="window.opener.imHere()">

<snip>

Having the page that is loaded in a new window report its presence will
tell you that the page has loaded, from which you may infer that it was
not pop-up blocked. That does not necessarily mean that the next attempt
to open a new window will not be blocked (though it suggests that it is
less likely).

On the other hand, the failure of the new page to report its arrival (or
the fact that it hasn't yet reported its arrival) cannot be used to
deduce that there is a pop-up blocker operating as they are not the only
factor in the failure of a page to load (or a long delay in loading).

It is the pop-up blocker detection that cannot be done, it is only
possible to make inferences about it, and only in such a way as would
make it difficult to meaningfully respond to the inference that a window
opening attempt had been blcoked.

Richard.
Jul 23 '05 #5
Actually Richard, not to seem like an arse or anything, but the function i
posted wasn't intended to be the complete thing, it was there to be adapted.
adding a couple of lines is all that is needed to detect the presence of a
popup blocker, but still; here is the "virtually" complete version
a global variable
var popBlocker=""

and adapting the function imHere...

function imHere(){
//if this function is called then the popup is opened
popBlocker="no"
}

function windowOpen{
if(popBlocker=="" || popBlocker=="no"){
popBlocker="testing..."
var child=window.open("blah.html","nam","args")
}else{
//popupBlocker was found
}
}

"Richard Cornford" <Ri*****@litotes.demon.co.uk> wrote in message
news:c7*******************@news.demon.co.uk...
Chris wrote:
Original page has the following function:

<script language="JavaScript">
var child=window.open("blah.html","nam","args")

function imHere(){
//if this function is called then the popup is opened
alert("YAY! no popup blocker for me, I'm free to annoy the world!")
}
</script>

child page (blah.html or whatever uses this for verification
<body onLoad="window.opener.imHere()">

<snip>

Having the page that is loaded in a new window report its presence will
tell you that the page has loaded, from which you may infer that it was
not pop-up blocked. That does not necessarily mean that the next attempt
to open a new window will not be blocked (though it suggests that it is
less likely).

On the other hand, the failure of the new page to report its arrival (or
the fact that it hasn't yet reported its arrival) cannot be used to
deduce that there is a pop-up blocker operating as they are not the only
factor in the failure of a page to load (or a long delay in loading).

It is the pop-up blocker detection that cannot be done, it is only
possible to make inferences about it, and only in such a way as would
make it difficult to meaningfully respond to the inference that a window
opening attempt had been blcoked.

Richard.

Jul 23 '05 #6
Chris wrote:
Actually Richard, not to seem like an arse or anything,
Top-posting evidence of a failure to comprehend logic to a programming
newsgroup is likely to give that impression.

<snip> adding a couple of lines is all that is needed
to detect the presence of a popup blocker,
The successful loading of a page in a new window could be used to infer
the absence of a pop-up blocker, but failure to load (or very
slow/delayed loading) cannot validly be used to infer the presence of
pop-up blockers. There are just too many other factors influencing that
situation.
but still; here is the
"virtually" complete version a global variable
var popBlocker=""

and adapting the function imHere...

function imHere(){
//if this function is called then the popup is opened
popBlocker="no"
}

function windowOpen{
if(popBlocker=="" || popBlocker=="no"){
popBlocker="testing..."
var child=window.open("blah.html","nam","args")
}else{
//popupBlocker was found

<snip>

But even if you did decide to deduce that a pop-up blocker was operating
when a page has not loaded, the test isn't worth much unless it is in a
position to do something; to react to the (possibly erroneous)
conclusion that a pop-up blocker was operating. As you have written it
you are only in a position to act when you receive confirmation that the
new window was not blocked, which is a situation that probably does not
need any positive/remedial response.

Richard.
Jul 23 '05 #7
Hmm... having just read your email again Richard (after having woken up this
time..) - I apologise for completely missing your point

/me skulks off feeling like a client....

"Chris" <he**********@btinternet.com> wrote in message
news:c7**********@hercules.btinternet.com...
Actually Richard, not to seem like an arse or anything, but the function i
posted wasn't intended to be the complete thing, it was there to be adapted. adding a couple of lines is all that is needed to detect the presence of a
popup blocker, but still; here is the "virtually" complete version
a global variable
var popBlocker=""

and adapting the function imHere...

function imHere(){
//if this function is called then the popup is opened
popBlocker="no"
}

function windowOpen{
if(popBlocker=="" || popBlocker=="no"){
popBlocker="testing..."
var child=window.open("blah.html","nam","args")
}else{
//popupBlocker was found
}
}

"Richard Cornford" <Ri*****@litotes.demon.co.uk> wrote in message
news:c7*******************@news.demon.co.uk...
Chris wrote:
Original page has the following function:

<script language="JavaScript">
var child=window.open("blah.html","nam","args")

function imHere(){
//if this function is called then the popup is opened
alert("YAY! no popup blocker for me, I'm free to annoy the world!")
}
</script>

child page (blah.html or whatever uses this for verification
<body onLoad="window.opener.imHere()">

<snip>

Having the page that is loaded in a new window report its presence will
tell you that the page has loaded, from which you may infer that it was
not pop-up blocked. That does not necessarily mean that the next attempt
to open a new window will not be blocked (though it suggests that it is
less likely).

On the other hand, the failure of the new page to report its arrival (or
the fact that it hasn't yet reported its arrival) cannot be used to
deduce that there is a pop-up blocker operating as they are not the only
factor in the failure of a page to load (or a long delay in loading).

It is the pop-up blocker detection that cannot be done, it is only
possible to make inferences about it, and only in such a way as would
make it difficult to meaningfully respond to the inference that a window
opening attempt had been blcoked.

Richard.


Jul 23 '05 #8
JRS: In article <c7**********@sparta.btinternet.com>, seen in
news:comp.lang.javascript, Chris <he**********@btinternet.com> posted at
Mon, 10 May 2004 01:33:22 :
Lines: 72
Hmm... having just read your email again Richard (after having woken up this
time..) - I apologise for completely missing your point

/me skulks off feeling like a client....

"Chris" <he**********@btinternet.com> wrote in message
news:c7**********@hercules.btinternet.com...
Actually Richard, not to seem like an arse or anything, but the function i
posted wasn't intended to be the complete thing, it was there to be

adapted.

Do not top-post. Do not over-quote. Attribution lines should precede
other material, in almost all circumstances.

Read the newsgroup FAQ until you understand it.

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 23 '05 #9
Dr John Stockton wrote:
Do not top-post. Do not over-quote. Attribution lines should precede
other material, in almost all circumstances.
Read the newsgroup FAQ until you understand it.


Do not post to comp.lang.JAVASCRIPT if your post contains no information
relating to JAVASCRIPT.

Suggesting better posting styles is one thing, and leads to a better group
of users. But lately, this group has been overrun by posting-style nazis who
focus more on posting correctly than actually discussing the topic of the
group.

Suggestions for better posting style should only be made in posts that
contain content that is relavent to the topic of the group.

--
Matt Kruse
Javascript Toolbox: http://www.mattkruse.com/javascript/
Jul 23 '05 #10
not quite richard no, if the popup was not blocked, then the variable is set
to "Testing.."
and in that case the thing to do would be to test for that situation and
adapt the website to use the main window instead of the popup

as far as "if the popup didn't load for another reason than a popup blocker,
that's a little anal retentive, since either way the popup didn't load, you
then know about it and can counteract the problems, i don't think the
original plan was to detect a popup blocker, but to detect if the popup
failed to load, and adapt the way the website runs to avoid the EU missing
content

"Richard Cornford" <Ri*****@litotes.demon.co.uk> wrote in message
news:c7*******************@news.demon.co.uk...

[:snip:]
function windowOpen{
if(popBlocker=="" || popBlocker=="no"){
popBlocker="testing..."
var child=window.open("blah.html","nam","args")
}else{
//popupBlocker was found

<snip>

But even if you did decide to deduce that a pop-up blocker was operating
when a page has not loaded, the test isn't worth much unless it is in a
position to do something; to react to the (possibly erroneous)
conclusion that a pop-up blocker was operating. As you have written it
you are only in a position to act when you receive confirmation that the
new window was not blocked, which is a situation that probably does not
need any positive/remedial response.

Richard.

Jul 23 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

38
by: Shaun McKinnon | last post by:
HI...Here's my problem...I have a popup window that loads when i want it to, but it's not sized properly. I've set the size, but it doesn't seem to work. I've been on 8 different websites to find...
4
by: danilo | last post by:
This Javascript + DHTML source code able to show a popup calendar to select one date in your web pages, complete the full sourcecode and its free distribuite (GNU lic)...
6
by: andrewkooi | last post by:
Greetings, I do not know whether such code exist but no harm asking: Is it possible for me to make visible a close button if the active window is a popup window or a new window (other than the...
26
by: Raffi | last post by:
Hi, We have a database application that runs in a popup Internet Explorer application window. The reason for this is to isolate the casual user from the address bar and the typical IE navigation...
1
by: Just D. | last post by:
Does anybody know the way to detect a popup blocker in the Internet Explorer? I was thinking that I know but the customers got a situation when I wasn't able to detect the Yahoo Toolbar Popup...
4
by: vickeybird | last post by:
I want to know if it is possible to detect if Pop up Blocker is enabled without trying to open a Pop Up windows. I'm trying to create a web analytics script and visible Pop up in case of disabled...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.