Detect Function or Pop-Up Blocking

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Richard Cornford

    #16
    Re: Detect Function or Pop-Up Blocking

    Brett Merkey wrote:[color=blue][color=green]
    >> The problem is that not all browsers support try/catch.[/color]
    >
    > Serious commercial implementations assume the range of browser
    > versions and configurations compatible with making a profit.[/color]

    Profits are made by taking money off people, for which the requirements
    are support for HTTP (preferably including secure), HTML and
    specifically HTML forms. There aren't many web browsers that do not
    facilitate that (or could be configured not to).
    [color=blue]
    > Assuming otherwise makes no sense.[/color]

    In much the same way as taking action that will positively prevent some
    potential customers from doing business does not make sense.
    [color=blue]
    > With that in mind, all browsers
    > support try...catch.[/color]

    That is wishful thinking. The sort of thought process that results in
    developers reducing the potential for making profits for no better
    reason than that they are not capable of doing any better (or even
    perceiving that it is possible to do better).

    But in the case of the proposed script try-catch does not help at all,
    as many pop-up blocking techniques will not generate exceptions in the
    script that attempts to open a window, while still not resulting in a
    new window.

    Richard.


    Comment

    • Richard Cornford

      #17
      Re: Detect Function or Pop-Up Blocking

      AM wrote:[color=blue]
      > I don't know if you've already tried this, but if you haven't
      > it might be worth a shot:
      >
      > function is_popup_blocke d() {
      > var mypopup=window. open("","win1", 'width=10,heigh t=10');
      > if (mypopup){
      > mypopup.close() ;
      > return false;
      > }
      > return true;
      > }
      >
      > This is of course dependant on how the blocker works internally. I
      > know this works with Google's basic popup blocker and IE, haven't
      > tried with NIS, maybe you can.[/color]
      <snip>

      But it will not work in the case of Norton Internet Security, because it
      inserts the script:-

      var SymRealWinOpen = window.open;

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

      window.open = SymWinOpen;

      - Which will return an Object from the - window.open - call, which will
      pass the - if (mypopup) - test, and then error on the call to the -
      close - method. Meaning the function will never return.

      It also will not work with most external pop-up blocking software as
      the - window.open - call will succeed and return a valid window
      reference. The external pop-up blocker will probably not act until the
      currently executing script has terminated (as the browser will probably
      have the CPU tied up for the duration), then it will get a chance to
      close the window (that is still usually so fast that the user never sees
      the new window).

      Richard.


      Comment

      • Richard Cornford

        #18
        Re: Detect Function or Pop-Up Blocking

        Reply Via Newsgroup wrote:
        <snip>[color=blue]
        > However... this makes the assumption that javascript is enabled
        > (which, if you're createing an application then I would guess you are
        > targetting folk who should have javascript enabled)...[/color]
        <snip>

        It is an odd piece of reasoning that a web application should be
        expected to "target" users with javascript enabled. An Internet business
        web application should be targeting the people who have enough money to
        pay for the products or services offered, and there is no relationship
        between having money and operating browsers with javascript enabled (or
        any particular web browsers or computer hardware).

        But a web application implies server-side scripting will be available,
        and server-side scripting facilitates the guaranteeing what everything
        can work for everyone regardless of client-side script support, browser
        type or OS (even if it can be arranged to work better and quicker with
        client-side scripting layered over a server-side fall-back). A
        completely robust result can be achieved by implementing a robust
        design. Introducing unnecessary dependencies would be a demonstration of
        a skills shortfall on the part of the developer and not something that
        is inherent to the system being created.

        Richard.


        Comment

        • Lasse Reichstein Nielsen

          #19
          Re: Detect Function or Pop-Up Blocking

          am_ggh@hotmail. com (AM) writes:

          Please don't top post.
          [color=blue]
          > I don't know if you've already tried this, but if you haven't it might
          > be worth a shot:
          >
          > function is_popup_blocke d() {
          > var mypopup=window. open("","win1", 'width=10,heigh t=10');
          > if (mypopup){
          > mypopup.close() ;
          > return false;
          > }
          > return true;
          > }
          >
          > This is of course dependant on how the blocker works internally.[/color]

          Oh yeah! I have seen at least one popup blocker that worked by
          changing window.open to
          function(){ return window; }
          That is, it returns the *current* window. Then you close it. Whoops :)

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

          Comment

          • Brett Merkey

            #20
            Re: Detect Function or Pop-Up Blocking

            <<But in the case of the proposed script try-catch does not help at all,
            as many pop-up blocking techniques will not generate exceptions in the
            script that attempts to open a window, while still not resulting in a
            new window.>>

            Do you know concretely of any popup blockers which generate an
            un-try-catch-able error? Haven't found one yet.

            Brett


            Comment

            • Richard Cornford

              #21
              Re: Detect Function or Pop-Up Blocking

              Brett Merkey wrote:[color=blue]
              > <<But in the case of the proposed script try-catch does not help at
              > all, as many pop-up blocking techniques will not generate exceptions
              > in the script that attempts to open a window, while still not
              > resulting in a new window.>>
              >
              > Do you know concretely of any popup blockers which generate an
              > un-try-catch-able error? Haven't found one yet.[/color]

              You can't have been looking very hard then as external pop-up blockers
              close additional browser windows from separate processes. They close new
              windows at some unspecified (and unknowable) point after the window has
              been created (usually shortly after). If the script has finished the
              opening of the window, and exited the try-catch block in which it was
              opened, when the window is closed, how is it going to generate an
              exception?

              But then a Proximatron filter inserting:-

              (function(){
              var o = window.open;
              var onloadCount = 0;
              var forDummys = function(){retu rn;};
              var f = function(a,b,c) {
              return new WindowDummy(a);
              };
              f.toString = function(){retu rn ''+o;};
              function WindowDummy(url ){
              this.self = this.window = this.parent =
              this.frames = this.top = this;
              this.opener = window;
              this.open = window.open;
              this.closed = false;
              this.location = new LocationDummy(u rl);
              this.document = new DocumentDummy(t his.location);
              this.length = 0;
              this.focus = forDummys;
              this.close = function(){this .closed = true;};
              this.navigator = window.navigato r;
              }
              function LocationDummy(u rl){
              this.href = url;
              this.toString = function(){retu rn this.href;};
              this.refresh = this.replace = forDummys;
              }
              function DocumentDummy(l oc){
              this.location = loc;
              this.body = this.documentEl ement = {};
              this.close = this.open = this.write = this.writeln = forDummys;
              this.links = this.anchors = this.forms = this.images = [];
              }
              window.open = f;
              })();

              - would leave the window opening script hard pressed to generate an
              error without also being to recklessly implemented for Internet use
              anyway, as the window.open call will return an object with the features
              and methods that would normally be expected of a new window reference.

              Just because the current content-inserting/re-writing proxy based pop-up
              blockers generally use crude and amateurish methods to replace the
              window.open function does not mean that they all will, or that the ones
              that currently do will continue to do so. In the pop-up blocking arms
              race the pop-up blockers always have the advantage of being in a
              position to bring bigger guns to bare because they are running locally
              and can stuff as much additional script into a web page as they like
              without significantly impacting on its download time, while the page
              author faces an absolute upper limit if the result is to be a viable web
              page.

              Richard.


              Comment

              • Kien

                #22
                Re: Detect Function or Pop-Up Blocking

                People who force internet users to see their pop-ups should be shot!
                The reason while I bought the pop-up killers is that pop-ups as rude
                and pathetic as email spams.

                I hope you and thugs like you will continue to fail.

                Kien



                "David McCulloch" <|@|.|> wrote in message news:<tqnec.652 13$z%1.36723@tw ister.rdc-kc.rr.com>...[color=blue]
                > 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[/color]

                Comment

                • David McCulloch

                  #23
                  Re: Detect Function or Pop-Up Blocking


                  "Kien" <caoxuankien@ho tmail.com> wrote in message
                  news:166d5d19.0 404121835.4814c 3cf@posting.goo gle.com...[color=blue]
                  > People who force internet users to see their pop-ups should be shot!
                  > The reason while I bought the pop-up killers is that pop-ups as rude
                  > and pathetic as email spams.
                  >
                  > I hope you and thugs like you will continue to fail.
                  >
                  > Kien[/color]

                  Kien,
                  If you are replying to me, I don't think you read my earlier messages.
                  You're safe. I am developing a service that actually makes GOOD use of
                  pop-ups (hard to believe that open.window could be used for anything other
                  than evil?). They aren't unsolicited and they aren't ads. Anyone who gets
                  them wants them actually has to request them. I wrote something for myself
                  a few years ago that I now want to make available to friends, family and
                  others in a more generic form.

                  Dave


                  Comment

                  • A. Nonymous

                    #24
                    Re: Detect Function or Pop-Up Blocking

                    Use DivLayers (i.e. <div>...</div>) as an alternative to pop-up windows.

                    Check out the posts on "Draggable Layers".

                    One of the posters created some pretty useful stuff!

                    "David McCulloch" <|@|.|> wrote in message
                    news:tqnec.6521 3$z%1.36723@twi ster.rdc-kc.rr.com...[color=blue]
                    > QUESTION-1:
                    > How can I detect if Norton Internet Security is blocking pop-ups?
                    >[/color]


                    Comment

                    Working...