473,834 Members | 1,460 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Detect Function or Pop-Up Blocking

QUESTION-1:
How can I detect if Norton Internet Security is blocking pop-ups?

QUESTION-2a:
How could I know if a particular JavaScript function has been declared?

QUESTION-2b:
How could I know if Window.Open has been redefined?

BACKGROUND:
NIS Pop-Up blocker inserts a JavaScript "SymWinOpen " function into a
client's HTML and then sets window.open = SymWinOpen. If I could detect
whether or not that "SymWinOpen " function name has been defined then I would
know if Norton's Pop-Up blocker was active.

Thanks for any help!

Dave
Jul 23 '05 #1
23 6536

"David McCulloch" <|@|.|> wrote in message
news:tq******** ***********@twi ster.rdc-kc.rr.com...
QUESTION-1:
How can I detect if Norton Internet Security is blocking pop-ups?

QUESTION-2a:
How could I know if a particular JavaScript function has been declared?

QUESTION-2b:
How could I know if Window.Open has been redefined?

BACKGROUND:
NIS Pop-Up blocker inserts a JavaScript "SymWinOpen " function into a
client's HTML and then sets window.open = SymWinOpen. If I could detect
whether or not that "SymWinOpen " function name has been defined then I would know if Norton's Pop-Up blocker was active.


But why would you care? There are dozens of other popup blockers out there
as well.

If a user doesn't want a pop-up, what can you do about it?
Jul 23 '05 #2

"Noozer" <do*******@me.h ere> wrote in message
news:%Gnec.8034 1$Pk3.41272@pd7 tw1no...

"David McCulloch" <|@|.|> wrote in message
news:tq******** ***********@twi ster.rdc-kc.rr.com...
QUESTION-1:
How can I detect if Norton Internet Security is blocking pop-ups?

QUESTION-2a:
How could I know if a particular JavaScript function has been declared?

QUESTION-2b:
How could I know if Window.Open has been redefined?

BACKGROUND:
NIS Pop-Up blocker inserts a JavaScript "SymWinOpen " function into a
client's HTML and then sets window.open = SymWinOpen. If I could detect
whether or not that "SymWinOpen " function name has been defined then I

would
know if Norton's Pop-Up blocker was active.


But why would you care? There are dozens of other popup blockers out there
as well.

If a user doesn't want a pop-up, what can you do about it?


Thanks for your reply. I am writing a web application that uses pop-ups
(not for advertising). If anyone wants to use my service then they must be
able to accept pop-ups from my site. I simply want to alert them to that
need (and explain how to do it) if I know that pop-ups are being blocked.
Any ideas about any of my questions?
Jul 23 '05 #3
"Noozer" <do*******@me.h ere> wrote in message
news:%Gnec.8034 1$Pk3.41272@pd7 tw1no...

"David McCulloch" <|@|.|> wrote in message
news:tq******** ***********@twi ster.rdc-kc.rr.com...
QUESTION-1:
How can I detect if Norton Internet Security is blocking pop-ups?

QUESTION-2a:
How could I know if a particular JavaScript function has been declared?

QUESTION-2b:
How could I know if Window.Open has been redefined?

BACKGROUND:
NIS Pop-Up blocker inserts a JavaScript "SymWinOpen " function into a
client's HTML and then sets window.open = SymWinOpen. If I could detect
whether or not that "SymWinOpen " function name has been defined then I

would
know if Norton's Pop-Up blocker was active.


But why would you care? There are dozens of other popup blockers out there
as well.

If a user doesn't want a pop-up, what can you do about it?


You are correct that there are dozens of pop-up blockers in use today.
Sometime in 2004, Microsoft plans to release its own version with Windows XP
SP2. I simply want to be able to detect the most common pop-up blocking
tools. Currently, NIS seems to be #1.
Jul 23 '05 #4

"David McCulloch" <|@|.|> wrote in message
news:cR******** ***********@twi ster.rdc-kc.rr.com...
"Noozer" <do*******@me.h ere> wrote in message
news:%Gnec.8034 1$Pk3.41272@pd7 tw1no...

"David McCulloch" <|@|.|> wrote in message
news:tq******** ***********@twi ster.rdc-kc.rr.com...
QUESTION-1:
How can I detect if Norton Internet Security is blocking pop-ups?

QUESTION-2a:
How could I know if a particular JavaScript function has been declared?
QUESTION-2b:
How could I know if Window.Open has been redefined?

BACKGROUND:
NIS Pop-Up blocker inserts a JavaScript "SymWinOpen " function into a
client's HTML and then sets window.open = SymWinOpen. If I could detect whether or not that "SymWinOpen " function name has been defined then I would
know if Norton's Pop-Up blocker was active.


But why would you care? There are dozens of other popup blockers out there as well.

If a user doesn't want a pop-up, what can you do about it?


You are correct that there are dozens of pop-up blockers in use today.
Sometime in 2004, Microsoft plans to release its own version with Windows

XP SP2. I simply want to be able to detect the most common pop-up blocking
tools. Currently, NIS seems to be #1.


You're probably better off just testing to see if your new window opened at
all instead of trying to detect the different software packages. Just
because NIS is installed doesn't mean it's set to block windows.

I'm not sure how you'd go about checking to see if your window opened, but
I'm sure that someone here could tell you - assuming that it's possible.
Jul 23 '05 #5
> You're probably better off just testing to see if your new window opened
at
all instead of trying to detect the different software packages. Just
because NIS is installed doesn't mean it's set to block windows.
No, no... NIS only inserts the "SymWinOpen " function when it intends to
block pop-ups. If the "SymWinOpen " Javascript function has been defined in
a client's HTML, that means the client's NIS is configured to block pop-ups
and NIS inserted its SymWinOpen function into my HTML code after it reached
the client. If Javascript could test the existence of the "SymWinOpen "
function, it could know if NIS is configured to block pop-ups.
I'm not sure how you'd go about checking to see if your window opened, but
I'm sure that someone here could tell you - assuming that it's possible.


I would like to be more proactive than that (i.e., I would like to tell my
clients that there might be a problem before it happens), but if I can't
then I can't. Detecting an open window should be simple and I never thought
about doing that -- thanks for the idea! NIS overrides the open's return
code, but I might be able to test the window's presence and/or attributes.
You have given me something to research. Thanks again.

Dave
Jul 23 '05 #6
David McCulloch wrote:
QUESTION-1:
How can I detect if Norton Internet Security is blocking pop-ups?
Unless you can add a version number (or range of version numbers) to
your specification for Norton Internet Security then the task is
impossible as it is not possible to tell how future versions will go
about pop-up blocking, and so impossible to tell what would need to be
detected.
QUESTION-2a:
How could I know if a particular JavaScript function has been
declared?
If the function has a name - if(typeof functionName == "function") { /*
function exists */ }, though it is not difficult to arrange that
declared functions are anonymous or defined within a closure. And also
possible to arrange that a unique function name is generated for each
separate request.
QUESTION-2b:
How could I know if Window.Open has been redefined?
There is no - Window.Open - function, - window.open - might be converted
into a string and tested to see if it conforms to one of the many
parterres of strings produced by native code functions on various
browsers. Though that can be defeated by code such as:-

(function(){
var o = window.open;
var f = function(a,b,c) {
return new Object();
};
f.toString = function(){retu rn ''+o;};
window.open = f;
})();

- in which the new - window.open - function would report exactly the
same string as the original.

You biggest aid in the specific task of detecting past and current
Norton Internet Security versions is that Norton have never employed
anyone with javascript skills to write the code that they are inserting.
So, at present, it is cured and relatively easy to detect (and
circumvent once detected) but that may change, and is most likely to
change if they discover people targeting their code for detection.
BACKGROUND:
NIS Pop-Up blocker inserts a JavaScript "SymWinOpen " function into a
client's HTML and then sets window.open = SymWinOpen. If I could
detect whether or not that "SymWinOpen " function name has been
defined then I would know if Norton's Pop-Up blocker was active.


The most viable strategy for detecting pop-up blockers (apart form
rigorously testing the object returned from the - window.open - call) is
to try to open a window that loads a page that will report back its
successful opening. The problem is deciding how long to give it to open,
A slow modem connection, when the server and intervening network is
heavily loaded, might necessitate quite a long wait before it was safe
to assume that the page was not going to load. And when a page doesn't
show up in the allotted time span it is still not possible to tell
whether it was because of the actions of a pop-up blocker or whether the
user closed the window before it had time to load the page (Alt-F4 and
the like).

Given the multitude and diversity of pop-up blocking mechanisms, the
best strategy for dealing with the problem is to design web sites and
web applications so that they do not need to attempt to open new windows
(especially as some browsers cannot open new windows anyway). The
majority of the applications of new windows that I see could be done
without going outside of the original window, and are apparently used
because opening a new window is the "easy" approach. Of course it is
only easy when the pop-up blocking issues are ignored, add any viable
attempt to detect, circumvent or compensate for pop-up blocking and
opening new windows suddenly doesn't look nearly as simple in comparison
with the reliable alternatives.

Richard.
Jul 23 '05 #7
> Unless you can add a version number (or range of version numbers) to
your specification for Norton Internet Security then the task is
impossible as it is not possible to tell how future versions will go
about pop-up blocking, and so impossible to tell what would need to be
detected.
Understood. I simply want to be able to detect today's most common
situations where a window cannot be opened. I realize that I will have to
adapt to future changes.
If the function has a name - if(typeof functionName == "function") { /*
function exists */ }, though it is not difficult to arrange that
declared functions are anonymous or defined within a closure. And also
possible to arrange that a unique function name is generated for each
separate request.
THANK YOU!!! That is the answer that will allow me to move forward. I
forgot about "typeof" (excuse me while I kick myself). I tested it and it
does what it needs to do. Thanks again! :-)
You biggest aid in the specific task of detecting past and current
Norton Internet Security versions is that Norton have never employed
anyone with javascript skills to write the code that they are inserting.
So, at present, it is cured and relatively easy to detect (and
circumvent once detected) but that may change, and is most likely to
change if they discover people targeting their code for detection.


True. In my case, however, the client really wants my pop-up windows so I
won't be the one whom Norton targets (I *will* probably be a victim of their
fallout, though). My windows aren't workarounds and they aren't abnoxious
advertisements. I have a real functional need that is best addressed by
opening new windows.

I have heard that Microsoft is planning to release their own version of
Pop-Up Blocking in Windows XP SP2. Fortunately for me, they plan to allow
clients to override their general settings by site. If Microsoft also
allows a developer to check a client's settings then legitimate developers
could benefit clients by giving them convenient instructions for changing
their settings.

Dave
Jul 23 '05 #8
Look up the JavaScript "try...catc h" statements. I use them to handle all
popup blockers equally.

Wrap your code to open a popup in the try statement. If it fails for any
reason, use the catch statement to redirect to an explanatory page or
show an alert (for instance) asking the user to disable popup blocking
for your domain.

Brett
http://web.tampabay.rr.com/bmerkey/
Jul 23 '05 #9
"Brett Merkey" <bm*****@tampab ay.rr.com> writes:
Look up the JavaScript "try...catc h" statements. I use them to handle all
popup blockers equally.


The problem is that not all browsers support try/catch. And the one
feature that could be used to recover from that would be
.... try/catch. So, it will just give a syntax error and fail in such a
browser. You need a fallback for try/catch then :)

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #10

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

Similar topics

23
15614
by: Michel Bany | last post by:
I am trying to parse responseXML from an HTTP request. var doc = request.responseXML; var elements = doc.getElementsByTagName("*"); the last statement returns an empty collection when running from IE6. It returns the expected collection when running under Firefox or Mozilla. Anybody can explain ? Michel.
4
2071
by: Mark | last post by:
Hi.. I have a c# class that i'm using to implement some extension functions and one of those functions is a simple push/pop stack. I made the c# code fairly generic, taking and returning objects - i.e public void push (object val { stack.Push (val) public object pop ( { return stack.Pop()
33
47639
by: Pushkar Pradhan | last post by:
I'm using clock() to time parts of my code e.g. clk1 = clock(); /* code */ clk2 = clock(); /* calculate time in secs */ ...... clk1 = clock(); /* code */ clk2 = clock();
3
1834
by: Richard Thornley | last post by:
Hello, I was just been given a project and I have some questions on how to accomplish the first part of the task. If a user sends an email to a specific email address I need to detect that
7
2361
by: changs | last post by:
Hi, all I have a asm code, I suspect it sort of socket programming. Can anyone here give some instructions on how to determine the function or give the psudo-code in C? Thanks in advance! Tony
14
3746
by: Wescotte | last post by:
I have an application that uses several file formats for similar data. So I've created various php files for each format containing the same functions which produce the same end result. Now I currently have a functions setup that just reads a file and determines which file type it is and includes the correct source. My goal is add a new function to each source called My_File_Format($filename) where each file checks to see if the...
2
3861
by: Amal P | last post by:
Hi, This is the program that i made to test the usage of inline function. I am using vc 6.0 compiler. Please see the below program. int NonInline( int a, int b ) { return ( a b )? a: b; }
10
3057
by: laredotornado | last post by:
Hi, Does anyone have a cross-browser function that given an id of a DIV element, can move the DIV to an absolute x,y position on the screen? Thanks, - Dave
4
2570
by: j_depp_99 | last post by:
The program below fails on execution and I think the error is in my pop function but it all looks correct.Also could someone check my code as to why my print function is not working? I havent included the other parts of my program but will if someone needs it. Please help; I have had it. I have checked all C++ websites and cannot figure it out. <code> template<class Type> void Novice<Type>::Print()
18
1861
by: Aaron Gray | last post by:
I know this has probably been argued to death, but I am going to raise it fresh again, and basically lets have an unofficial 'isArray()' contest that we can hopefully put it to rest as best as we can. I have found things that work perfectly well as long as you don't try them on MSIE, ie adding Object and Array prototype isArray functions, thus :- Object.prototype.isArray = function() { return false } Array.prototype.isArray =...
0
9796
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9643
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10505
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9329
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7755
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6952
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5624
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5790
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4425
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

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.