Newbie: I don't understand "function SymWinOpen(url, name, attributes)"

Discussion in 'Javascript' started by Larry Woods, Apr 6, 2004.

  1. Larry Woods

    Larry Woods Guest

    I am finding the following code snippet in many pages that I examine. Can
    anyone explain (1) what the significance of this code snippet is, and (2)
    what development package generates it?


    Snippet (and there is more...)

    var SymRealWinOpen = window.open;

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

    window.open = SymWinOpen;

    TIA,

    Larry Woods
     
    Larry Woods, Apr 6, 2004
    #1
    1. Advertising

  2. What you're looking at, Larry, appears to be javascript, and the author is
    taking the long way around to accomplish a very simple task. The code below
    is - for all practical purposes - no different from

    window.open(url, name, attributes)

    My guess it is that it was written by a C++ programmer who felt the need to
    obfuscate. :) Inline notes below.

    - Wm


    --
    William Morris
    Semster, Seamlyne reProductions
    Visit our website, http://www.seamlyne.com, for the most comfortable
    historically inspired clothing you can buy!

    > Snippet (and there is more...)


    There almost always is.


    > var SymRealWinOpen = window.open;


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


    Ghosting an intrinsic function. Assuming that "url", "name" and
    "attributes" are actual values and not just parameters as you've shown, it
    would be possible then to issue the next call:

    > window.open = SymWinOpen;


    and quickly get the same window and attribs over and over again.
     
    William Morris, Apr 6, 2004
    #2
    1. Advertising

  3. Larry Woods

    Larry Woods Guest

    Thanks, William,

    The "interesting" thing about this is that I have found this code in MANY
    pages from various sites. It must be generated by some developement
    package; e.g., Frontpage(?).

    If I could bother you a little further, here is the code from the beginning
    of the page, and also some code from the end of the page. Again, this seems
    to be a "reoccuring theme" in many pages that I have seen.

    --------------- At top of page ---------------

    <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 bottom of page ------------

    <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>

    Thanks again,

    Larry Woods

    "William Morris" <> wrote in
    message news:c4ucgi$2mn24g$-berlin.de...
    > What you're looking at, Larry, appears to be javascript, and the author is
    > taking the long way around to accomplish a very simple task. The code

    below
    > is - for all practical purposes - no different from
    >
    > window.open(url, name, attributes)
    >
    > My guess it is that it was written by a C++ programmer who felt the need

    to
    > obfuscate. :) Inline notes below.
    >
    > - Wm
    >

    ------------ text removed ---------------
     
    Larry Woods, Apr 6, 2004
    #3
  4. Larry Woods wrote:
    > I am finding the following code snippet in many pages that I examine.
    > Can anyone explain (1) what the significance of this code snippet is,
    > and (2) what development package generates it?
    >
    >
    > Snippet (and there is more...)
    >
    > var SymRealWinOpen = window.open;
    >
    > function SymWinOpen(url, name, attributes)
    > {
    > return (new Object());
    > }
    >
    > window.open = SymWinOpen;


    It is code inserted by a content inserting/re-writing proxy (firewall or
    some such) to achieve pop-up blocking. It will not appear on the
    original HTML pages, instead it is being added at some stage in the
    transmission of the HTML.

    Richard.
     
    Richard Cornford, Apr 6, 2004
    #4
  5. Larry Woods wrote:

    > I am finding the following code snippet in many pages that I examine. Can
    > anyone explain (1) what the significance of this code snippet is, and (2)
    > what development package generates it?
    >
    >
    > Snippet (and there is more...)
    >
    > var SymRealWinOpen = window.open;
    >
    > function SymWinOpen(url, name, attributes)
    > {
    > return (new Object());
    > }
    >
    > window.open = SymWinOpen;
    >
    > TIA,
    >
    > Larry Woods
    >
    >


    I can identify this - You are likely to have Norton Internet Security
    installed, true?

    It has an anti-popup feature implemented where it inserts code to screw
    up/prevent window.open code from working - Older versions stopped
    popupes, even one's that had been clicked on (unless you has authorised
    the website) - Newer version of the software only limits popups that
    would occur after a length of time, onChange or onLoad event.

    Therefore, to summarise - the code is not put in by the webmasters of
    the websites you've visiting - its been put in by some anti-virus
    program you have running locally.

    randelld
     
    Reply Via Newsgroup, Apr 6, 2004
    #5
  6. Larry Woods

    Larry Woods Guest

    Thanks, guys!

    I think you nailed it. I DO have Norton, and I noticed that on another
    computer that I have (without Norton) this code didn't exist. I thought
    possibily it was the browser.

    Larry Woods

    "Reply Via Newsgroup" <> wrote in message
    news:NLDcc.38123$oR5.26201@pd7tw3no...
    > Larry Woods wrote:
    >
    > > I am finding the following code snippet in many pages that I examine.

    Can
    > > anyone explain (1) what the significance of this code snippet is, and

    (2)
    > > what development package generates it?
    > >
    > >
    > > Snippet (and there is more...)
    > >
    > > var SymRealWinOpen = window.open;
    > >
    > > function SymWinOpen(url, name, attributes)
    > > {
    > > return (new Object());
    > > }
    > >
    > > window.open = SymWinOpen;
    > >
    > > TIA,
    > >
    > > Larry Woods
    > >
    > >

    >
    > I can identify this - You are likely to have Norton Internet Security
    > installed, true?
    >
    > It has an anti-popup feature implemented where it inserts code to screw
    > up/prevent window.open code from working - Older versions stopped
    > popupes, even one's that had been clicked on (unless you has authorised
    > the website) - Newer version of the software only limits popups that
    > would occur after a length of time, onChange or onLoad event.
    >
    > Therefore, to summarise - the code is not put in by the webmasters of
    > the websites you've visiting - its been put in by some anti-virus
    > program you have running locally.
    >
    > randelld
     
    Larry Woods, Apr 6, 2004
    #6
  7. Larry Woods

    Larry Woods Guest

    You nailed it. See my note to the other responder.

    Thanks.

    Larry Woods

    "Richard Cornford" <> wrote in message
    news:c4uia3$95e$1$...
    > Larry Woods wrote:
    > > I am finding the following code snippet in many pages that I examine.
    > > Can anyone explain (1) what the significance of this code snippet is,
    > > and (2) what development package generates it?
    > >
    > >
    > > Snippet (and there is more...)
    > >
    > > var SymRealWinOpen = window.open;
    > >
    > > function SymWinOpen(url, name, attributes)
    > > {
    > > return (new Object());
    > > }
    > >
    > > window.open = SymWinOpen;

    >
    > It is code inserted by a content inserting/re-writing proxy (firewall or
    > some such) to achieve pop-up blocking. It will not appear on the
    > original HTML pages, instead it is being added at some stage in the
    > transmission of the HTML.
    >
    > Richard.
    >
    >
     
    Larry Woods, Apr 6, 2004
    #7
  8. I learned something new. Thanks from me, too.


    "Richard Cornford" <> wrote in message
    news:c4uia3$95e$1$...
    > Larry Woods wrote:
    > > I am finding the following code snippet in many pages that I examine.
    > > Can anyone explain (1) what the significance of this code snippet is,
    > > and (2) what development package generates it?
    > >
    > >
    > > Snippet (and there is more...)
    > >
    > > var SymRealWinOpen = window.open;
    > >
    > > function SymWinOpen(url, name, attributes)
    > > {
    > > return (new Object());
    > > }
    > >
    > > window.open = SymWinOpen;

    >
    > It is code inserted by a content inserting/re-writing proxy (firewall or
    > some such) to achieve pop-up blocking. It will not appear on the
    > original HTML pages, instead it is being added at some stage in the
    > transmission of the HTML.
    >
    > Richard.
    >
    >
     
    William Morris, Apr 7, 2004
    #8
  9. William Morris wrote:
    > I learned something new.


    These proxy programs are increasingly common, it appears to be a
    standard facility on personal firewalls, for example. And people, seeing
    a checkboxes labelled "Ad blocking", "Privacy", and the like, are
    inclined to decide that they can do without Internet advertising,
    pop-ups and so on, and activate (or leave defaulted) the options.
    Instantly killing a fare number of optimistically authored javascripts.

    It is an appreciation of how common these programs are, combined with
    the other two methods of blocking pop-ups, that has lead me to generally
    disparage the act of opening a new window with scripts on the Internet.
    The consequent problems of inter-window communication, synchronisation
    and maintaining references to opened windows across page transitions are
    insignificant in comparison to the problem of determining whether the
    window opened at all in the first place (and managing to do something
    meaningful if it didn't). You would be hard pressed to locate a window
    opening script that even considers the possibility of the failure of the
    window.open call, let alone was interested in coping with it.

    Which is why it is more interesting (and ultimately more productive) to
    consider how tasks that have commonly been assigned to new window
    instances can be achieved without the need for new windows.

    > Thanks from me, too.

    <snip>

    You are welcome, but you might care to familiarise yourself with this
    group's FAQ and particularly the material on positing styles (and
    explicitly, not top posting).

    <URL: http://jibbering.com/faq/ >

    Richard.
     
    Richard Cornford, Apr 7, 2004
    #9
  10. Larry Woods

    heyin huang Guest

    This article help me resolve the problem that the javascirpt snippet
    causes many javascript error in IE 5.0. Norton Internet Security
    generates the codes.

    Thanks a lot.

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    heyin huang, Apr 13, 2004
    #10
  11. Hi All,

    Sorry to butt in mid-thread, but this is exactly something I am having a
    problem with on my own site at present.

    Richard wrote:

    >> window.open = SymWinOpen;


    > It is code inserted by a content inserting/re-writing
    > proxy (firewall or some such) to achieve pop-up
    > blocking. It will not appear on the
    > original HTML pages, instead it is being added at some
    > stage in the transmission of the HTML.


    I don't have Norton Personal Firewall installed, but I do run
    Systemworks, Norton Antispam and Norton Antivirus. Is Norton AV
    something which will insert this code as well as the Personal Firewall?
    I do have a Firewall running in my wireless router, but disabling the
    firewall there has no effect and this spurious code is still displayed
    inserted on SOME on the pages of my site when I try to view them, in one
    case completely replacing the entire code of the original page.

    I can't see any option in Norton Antivirus whereby I can disable this
    "feature", but maybe someone else knows of a workaround (Are there, for
    example, any decent antivirus packages that don't do this?

    Regards,
    Oliver

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Oliver Clarke, Apr 15, 2004
    #11
  12. Oliver Clarke wrote:
    <snip>
    > I don't have Norton Personal Firewall installed, but I do run
    > Systemworks, Norton Antispam and Norton Antivirus.


    I would suspect Norton Antispam out of that collection, as unrequested
    pop-ups are generally categorised along with spam.

    > Is Norton AV something which will insert this
    > code as well as the Personal Firewall?


    That would depend a lot on how it worked, but acting as a content
    inserting/re-writing proxy is not a requirement for an anti-virus
    program. Though it might be thrown in as an extra.

    > I do have a Firewall running in my wireless router, but
    > disabling the firewall there has no effect and this spurious


    A router firewall is a different kettle of fish entirely, it is almost
    certainly not responsible for this.

    > code is
    > still displayed inserted on SOME on the pages of my site when I try
    > to view them, in one case completely replacing the entire code of the
    > original page.

    <snip>

    If it is only some of the pages there may be some pattern to it that
    could be identified, allowing the provoking conditions to be avoided.
    But replacing the entire source of a page certainly seems odd (unless it
    is something like Add blocking based on element size and the page only
    contains coincidentally sized elements).

    There has recently been a whole spate of people posting problems caused
    by pop-up blockers that they didn't even know that they were using. It
    makes the argument that pop-ups are OK because you can tell the user to
    disable their pop-up blockers in order to use a site somewhat hollow.

    Richard.
     
    Richard Cornford, Apr 15, 2004
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. simon

    Error message I don't understand

    simon, Dec 5, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    325
    Hatim R
    Dec 5, 2003
  2. m miller

    don't understand error

    m miller, Jan 9, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    1,760
    smitdso
    Sep 8, 2006
  3. Wayne  Wengert

    Don't Understand

    Wayne Wengert, May 1, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    382
    Wayne Wengert
    May 1, 2004
  4. Henri
    Replies:
    0
    Views:
    363
    Henri
    Oct 12, 2004
  5. zalek
    Replies:
    10
    Views:
    565
    Daniel Pitts
    Jun 30, 2008
Loading...

Share This Page