homepage Welcome to WebmasterWorld Guest from 54.227.11.45
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Stopping Norton Antivirus's popup blocker
if(window.SymError)
thailinh




msg:1486249
 1:15 am on Feb 8, 2006 (gmt 0)

Hi guys as far as i know the javaScript which Norton Internet Security inserted into IE and FF Browsers to block pop-up and disable "window.open" in every pages, and we have discussed here, although this topic has closed but i still concern about it, you can find the discussion here
[webmasterworld.com...]
and this is the code from NAV:
<script language="JavaScript">
<!--

function SymError()
{
return true;
}

window.onerror = SymError;

var SymRealWinOpen = window.open;

function SymWinOpen(url, name, attributes)
{
return (new Object());
}

window.open = SymWinOpen;

//-->
</script>
at first i did not know what this code is, i asked my friend and he thought that was spy ware in my PC.
now i have found a simple way to kick this ass
it's quite simple to block this code

just put this qoute on the top of your <!-- <html> pages, but don't block it:
just do this: <!-- <html> and this is the rest of your page.

and that's it, it does the job
now have a go with it, and let me know

 

gph




msg:1486250
 5:39 am on Feb 8, 2006 (gmt 0)

I know little about Norton.

Having said that I copied the posted Norton script and tried this. It seems to work but it's too simple. Norton must be doing more elsewhere and/or I'm not understanding how their popup blocker works.

(typeof SymRealWinOpen=='undefined'?window.open:SymRealWinOpen)(url);

thailinh




msg:1486251
 8:28 am on Feb 8, 2006 (gmt 0)

I think the program will ignore a blank page, and as it see the qoute in html page like this <!-- <html> page code </html>//--> it thought that is a comment, and everything above it is blank, now try to make a blank page and put it on your website then view source a blank page, there wouldn't be Norton's code in it.
simetimes simple thing can solve a complicated thing :-)

Bernard Marx




msg:1486252
 11:32 am on Feb 8, 2006 (gmt 0)

An interesting discovery.

However, I think many people would be rather wary of enclosing their entire document in a comment tag, choosing to avoid using popup windows instead.

Rambo Tribble




msg:1486253
 2:07 pm on Feb 8, 2006 (gmt 0)

As well, I'm rather suspicious of the validation implications, not to mention that if a browser decides to take the open comment tag literally, it won't render the page at all.

Another approach that might work would be to assign the original window.open, etc. to variables before Norton does its magic, then through a delayed script reassign the values to their original objects.

Still, that would do nothing to circumvent native popup blockers, such as employed by Firefox and others. In those cases CSS probably offers the best alternative.

gph




msg:1486254
 5:56 am on Feb 9, 2006 (gmt 0)

Well I got curious and downloaded the NIS 15 day trial. What I posted above works.

A 40mb download with, what looks like to me, 15 minutes of thought put into the popup blocker.

DrDoc




msg:1486255
 6:02 am on Feb 9, 2006 (gmt 0)

(typeof SymRealWinOpen=='undefined'?window.open:SymRealWinOpen)(url);

I'd much rather use that than the open comment thingy :)

Rambo Tribble




msg:1486256
 1:59 pm on Feb 9, 2006 (gmt 0)

I'm not sure it's quite that simple, DrDoc. It has been years since I ran Norton on Windows and I eschew popups vehemently, but as I recall the Norton code was actually far more extensive than what has been posted. The program on my machine appended code both to the head and after the closing html tag. It not only reassigned the window.open call, but substantially modified the window object with a new prototype declaration.

Rambo Tribble




msg:1486257
 4:17 pm on Feb 9, 2006 (gmt 0)

Alright, Marx, I hear you back there sniggering, "He eschews vehemently! Well, gesundheit, old bean, gesundheit!"

Always one to raise the level of discourse, eh wot?

gph




msg:1486258
 11:58 pm on Feb 9, 2006 (gmt 0)

as I recall the Norton code was actually far more extensive than what has been posted. The program on my machine appended code both to the head and after the closing html tag.

You're right, there is more. The present version dumps the following after </html>

<script language="JavaScript">
<!--
var SymRealOnLoad;
var SymRealOnUnload;

function SymOnUnload()
{
window.open = SymWinOpen;
if(SymRealOnUnload!= null)
SymRealOnUnload();
}

function SymOnLoad()
{
if(SymRealOnLoad!= null)
SymRealOnLoad();
window.open = SymRealWinOpen;
SymRealOnUnload = window.onunload;
window.onunload = SymOnUnload;
}

SymRealOnLoad = window.onload;
window.onload = SymOnLoad;

//-->
</script>

I didn't mention that script before because it doesn't do anything of consequence.

gph




msg:1486259
 5:26 am on Feb 10, 2006 (gmt 0)

it doesn't do anything of consequence

I should rephrase that, it doesn't do anything of consequence to stop the use of SymRealWinOpen.

Bernard Marx




msg:1486260
 10:14 pm on Feb 10, 2006 (gmt 0)

Although I am the beneficiary of a moderately expensive classical education, I cannot recall ever having used the words vehemently or eschew. In fact, I'm not sure about the pronuncation, so I'm not about to try them out even here, alone with my PC.

It is quite likely that my first use of these two words in written form is right before your eyes.

Strange that, innit.

Rambo Tribble




msg:1486261
 11:26 pm on Feb 10, 2006 (gmt 0)

Well, trust me, then: Vehement eschewal is quite an appropriate response vis-a-vis popup windows.

newb




msg:1486262
 10:48 pm on Feb 13, 2006 (gmt 0)

Yeh, this does the job, i didnt know that, as my site has lots of javascript, and this Norton's code make it hard to work.

Bernard Marx




msg:1486263
 11:55 pm on Feb 13, 2006 (gmt 0)

Outright dismissal

jeffsbaker




msg:1486264
 9:33 pm on Feb 16, 2006 (gmt 0)

I have found out a way to put a message to your web page viewers if they are not able to see a javascript on your page because they have some kind of ad blocker including Norton.

First of all. Before your javascript that is not being called add this javascript setting JAVA_FLAG to 0.

SCRIPT language="Javascript">
var JAVA_FLAG = 0;
</SCRIPT>

Next, you will write the code that calls your javascript. Ex:

<SCRIPT language="Javascript" src="yourscript.js">
</SCRIPT>

now somewhere at the top of "yourscript.js" add the code:
JAVA_FLAG = 1;
This will let the following javascript know if yourscript.js was called or not and if the message needs to be displayed. Finally in your file write this javascript:

<script language="Javascript">
if (JAVA_FLAG == 0) // meaning yourscript.js was not loaded
{
if(window.SymError) // If Norton is installed and changing page
{
document.write('You have Norton Internet Security or Norton '+
'Personal Firewall installed on this computer. '+
'If the results do not show up then you need to disable '+
'Ad Blocking in Norton Internet Security and then '+
'refresh this page.<BR><BR> ');
}
else // if Norton not installed but still no yourscript.js
{
document.write('You have a program installed on this computer '+
'that is blocking the javascript for the results on '+
'this page. It is most likely an ad blocking program '+
'that might be part of a security program such as '+
'<FONT COLOR="RED">Norton Internet Security</FONT> or '+
'<FONT COLOR="RED">Norton Personal Firewall</FONT> '+
'You can try disabling the ad blocking program on '+
'your computer and refreshing this page.<BR><BR>');
} // end else
// write below for both errors
document.write('If that does not work you may also have to clear the '+
'Temporary Internet Files cache for your browser. '+
'(Ex: In Internet Explorer, click on "Tools" then '+
'"Internet Options" then "Delete Files" and then '+
'refresh this page.)<BR><BR>');
} // end if

</script>

Let me know if this code has proved useful for you.

Bernard Marx




msg:1486265
 9:50 pm on Feb 16, 2006 (gmt 0)

A nice idea, yet it might involve one less step if you just set

var yourscript = 1;

inside the linked script. Then you can test for it on the page:

if(this.yourscript){...

===================================

What is [blue]SymError[/blue]? I don't have Norton, so I'd like to know more.

1) Is this variable only set to a true value when Norton has blocked something?

2) If so, is the variable present - but false - when Norton is active but has not yet blocked anything?

ie

alert("SymError" in this) [green]// -> true[/green]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved