473,586 Members | 2,490 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3178
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.******@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 23 '05 #2
In article <40************ **********@merc ury.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="JavaS cript">
var child=window.op en("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******@NOSPA M.comcast.net> wrote in message
news:MP******** *************** *@nntp.lucent.c om...
In article <40************ **********@merc ury.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="JavaS cript">
var child=window.op en("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="tes ting..."
var child=window.op en("blah.html", "nam","args ")
}else{
//popupBlocker was found
}
}

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

<script language="JavaS cript">
var child=window.op en("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="tes ting..."
var child=window.op en("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**********@b tinternet.com> wrote in message
news:c7******** **@hercules.bti nternet.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="tes ting..."
var child=window.op en("blah.html", "nam","args ")
}else{
//popupBlocker was found
}
}

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

<script language="JavaS cript">
var child=window.op en("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**********@s parta.btinterne t.com>, seen in
news:comp.lang. javascript, Chris <he**********@b tinternet.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**********@b tinternet.com> wrote in message
news:c7******* ***@hercules.bt internet.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.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demo n.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.JAVAS CRIPT 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

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

Similar topics

38
5035
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 out what i'm doing wrong, and so far it seems i'm doing it the right way. Here's my code...any suggestions would be appreciated. <script...
4
1859
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) http://www.prioregroup.com/dhtmlcalendar.html :) Sorry for my english. - Danilo
6
2670
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 main window)? What I mean is this: If the present window is the main window, then the close button should
26
6801
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 buttons. The application has a browser test page that displays an error message when a popup blocker is found and opens a popup page stating the...
1
1315
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 Blocker and the app screwed up. I'm using this code in ASPX page right now: var wobj =...
4
4265
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 PopUp Blocker is not being accepted.
0
7915
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6617
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5712
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3838
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3869
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2345
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1184
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.