Content
- Home
- Action
- Blogging
- Croydon Residents Against Parking Plans
- CSS
- Flashmobs
- Gallery
- Garden Project
- Holidays and trips
- Life
- Listening
- Media Management MA
- News
- Opinion
- Pittock Reunion
- Rants
- Reading
- Simon Cox's
- Standards
- Tech
- Tickled
- Watching
- Web
- Webcam
- All entries
- Tag Cloud
- Loxley Barton Falls
Webcam
Home » Web » Javascript SymWinOpen function pain
« What county do you really live in? | Main | Comic Life »
Javascript SymWinOpen function pain
This one really bugged me. I was trying to validate some code I had uploaded to a staging area on a site and it would not validate back on my PC running CSE HTML Validate because something somewhere was inserting extra bits of javascript, SymWinOpen, and I could not work out what was happening. I was getting the same added script in Firefox, IE and CSE HTML Validator (and this extra code was stopping my pages from validating) until I opened the same page up in Safari on my Mac and it didn't have the extra code...
I eventually found that it was Norton Anti Virus 'adjusting' the pages for me as they came in on my PC. I probably should be grateful that its doing its job but you can turn it off:
This is the code:
function SymError()
{
return true;
}
window.onerror = SymError;
var SymRealWinOpen = window.open;
function SymWinOpen(url, name, attributes)
{
return (new Object());
}
window.open = SymWinOpen;
//
followed by:
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;
//
Hopefully this will prevent hair loss as people try to figure out where this extra code is coming from!
Update!
Just discovered that the link I had to the Symantec page with infomation no longer resolves. So please follow this link for more information on the SymWinOpen function code insertion issue.
Posted by Simon at December 23, 2005 6:52 PM
Trackback Pings
Comments
- 1 November 13, 2006 5:08 PM Ian P. Hudson
Hi! FYI the Link on "So please follow this link for more information on the SymWinOpen function code insertion issue." to http://searchg.symantec.com/search?q=window.onerror+%3D+SymError;&context=hho&src=hho&output=xml_no_dtd&ie=UTF-8&oe=UTF-8&client=symc_en_US&proxystylesheet=symc_en_US&site=symc_en_US
is a dead "No results from your search" page.
I have been seeing this Javascript in many pages of which I looked at source but it doesn't do it if I visit sites I wrote when I view the source after visiting as others would. Is NIS remembering the sites of which I am webmaster? I wonder...
- 2 April 21, 2007 7:33 AM Adamal
Since (Symantec) Norton Internet Security is actually storing window.open in SymRealWinOpen, you can easily restore it with the following script:
if (window.SymRealWinOpen) {
window.open = window.SymRealWinOpen;
}
SymWinOpen = window.open;Incidentally, Norton Internet Security also overrides window.onerror, which may prevent you from seeing error messages in your own scripts. You can restore it to the default error handler with the following script:
window.onerror = null;









