Re: Norton Internet Security blocking execution of scripts loaded via XMLHtppReq

"John M. Hann" <[email protected]> Mon, 06 Mar 2006 22:33:29 -0000
Newsgroups gmane.comp.web.dom.wdf
Message-ID <[email protected]>
Hi all,

Turns out this is my bug.

Norton adds the following script tag to all pages loaded, even those via
XMLHttpRequest:


<scriptlanguage="JavaScript">
<!--
function SymError()
{
   return true;
}

window.onerror = SymError;


var SymRealWinOpen = window.open;


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

window.open = SymWinOpen;


//-->
</script>
The open comment "<!--"makes IE fail on the eval().    Here's the fixed
script for completness:

AjaxBase.prototype.executeScripts = function(html) {
   var reFindStart = new RegExp("<script.*?>", "im");
   var strFindEnd = "</script", strFindStartComment = "<!--";
   var scripts = html.split(reFindStart);
   for (var i = 0; i < (scripts ? scripts.length : 0); i++) {
     var end = scripts[i].indexOf(strFindEnd);
     if (end > 0) {
       var start = scripts[i].indexOf(strFindStartComment);
       start = (start < 0) ? 0 : start + strFindStartComment.length;
       var script = scripts[i].substr(start, end - start);
       eval(script);
     }
   }
}

-- John


--- In [email protected], "John M. Hann" <john.hann@...> wrote:
>
> Has anyone else seen this?  Norton Internet Security seems to be
> blocking execution of same-site script tags loaded via XMLHtppRequest.
>
> I know there are at least two other common methods for loading scripts
> dynamically, but for simplicity and speed I have been embedding them
> into the html returned via calls to XMLHttpRequest for some clients'
> "AJAX" projects.
>
> Suddenly, I have found that Norton Internet Security is aborting the
> main Javascript routine (not the dynamically loaded scripts) without
> an error message of any sort.  Processing just stops when the
> following function executes:
>
> AjaxBase.prototype.executeScripts = function(html) {
>    // can't find a regexp that finds complete script tags in FF 1.5!
>    // so, do it brute force:
>    var reFindStart = new RegExp("<script.*?>", "im");
>    var strFindEnd = "</script";
>    var scripts = html.split(reFindStart);
>    for (var i = 0; i < (scripts ? scripts.length : 0); i++) {
>      var end = scripts[i].indexOf(strFindEnd);
>      if (end > 0) {
>        var script = scripts[i].substr(0, end);
>        eval(script);
>      }
>    }
> }
>
> Again, the html was retrieved from the same site as the main page. 
The
> HTML is returned fine.  This is the script tag that is being returned
in
> the html:
>
> <script type="text/javascript">
> window.homeValue = {"HvbLowValue":581600,"HvbHiValue":666400};
> window.homeAddress = {"Address1":"41 Some
>
Rd","Address2":null,"City":"Somewhere","State":"MA","Zip":"01801-0030"}
> </script>
> Any ideas?
>
> -- John Hann
> http://e-numera.com/ <http://e-numera.com/>
>
>
> [Non-text portions of this message have been removed]
>



[Non-text portions of this message have been removed]



Unsubscribe
[email protected]

List info
http://www.quirksmode.org/dom/list.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wdf-dom/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/