Loading ...
Sorry, an error occurred while loading the content.

ADsafe[]

Expand Messages
  • Douglas Crockford
    ADsafe took a big usability hit when the Firefox[-6] bug was discovered. ADsafe took the necessary but highly undesirable step of outlawing the use of the []
    Message 1 of 5 , Apr 18 6:37 PM
    View Source
    • 0 Attachment
      ADsafe took a big usability hit when the Firefox[-6] bug was discovered. ADsafe took the necessary but highly undesirable step of outlawing the use of the [] subscript operator except when the subscript expression was a non-negative number or an approved string.

      Thanks to a suggestion by Jasvir Nagra, ADsafe allows [] for all number literals as well as strings starting with '-'. It also accepts subscripts that are expressions that can be easily determined to be strings.

      adsafe.js's initialization now contains the following (which, coincidentally, demonstrates the Principle of Correspondence):

      if (Function.__defineGetter__) {
      (function (p, f) {
      p.__defineGetter__('-1', f);
      p.__defineGetter__('-3', f);
      p.__defineGetter__('-6', f);
      }(Function.prototype, function () {
      return null;
      }));
      }

      For browsers that have a __defineGetter__ method, that method will be used to install getters for [-1], [-3], and [-6] that will return null. This is thought to plug the Firefox leak.

      JSLint will now allow subscript expressions where the outermost operator is one of these prefix operators

      - + ~ typeof

      or one of these infix operators

      - * / % & | << >> >>>
    • Freeman, Tim
      Care to post a citation for the Firefox[-6] bug? Google doesn t do a very good job searching for [-6]. Sounds pretty bizarre, if -1, -3, and -6 are special.
      Message 2 of 5 , Apr 18 7:54 PM
      View Source
      • 0 Attachment

        Care to post a citation for the Firefox[-6] bug?  Google doesn't do a very good job searching for [-6].  Sounds pretty bizarre, if -1, -3, and -6 are special.

         

        From: caplet@yahoogroups.com [mailto:caplet@yahoogroups.com] On Behalf Of Douglas Crockford
        Sent: Monday, April 18, 2011 6:38 PM
        To: caplet@yahoogroups.com
        Subject: [caplet] ADsafe[]

         

         

        ADsafe took a big usability hit when the Firefox[-6] bug was discovered. ADsafe took the necessary but highly undesirable step of outlawing the use of the [] subscript operator except when the subscript expression was a non-negative number or an approved string.

        Thanks to a suggestion by Jasvir Nagra, ADsafe allows [] for all number literals as well as strings starting with '-'. It also accepts subscripts that are expressions that can be easily determined to be strings.

        adsafe.js's initialization now contains the following (which, coincidentally, demonstrates the Principle of Correspondence):

        if (Function.__defineGetter__) {
        (function (p, f) {
        p.__defineGetter__('-1', f);
        p.__defineGetter__('-3', f);
        p.__defineGetter__('-6', f);
        }(Function.prototype, function () {
        return null;
        }));
        }

        For browsers that have a __defineGetter__ method, that method will be used to install getters for [-1], [-3], and [-6] that will return null. This is thought to plug the Firefox leak.

        JSLint will now allow subscript expressions where the outermost operator is one of these prefix operators

        - + ~ typeof

        or one of these infix operators

        - * / % & | << >> >>>

      • Douglas Crockford
        ... https://bugzilla.mozilla.org/show_bug.cgi?id=507453 http://www.thespanner.co.uk/2009/07/14/hidden-firefox-properties-revisited/
        Message 3 of 5 , Apr 19 9:13 AM
        View Source
        • 0 Attachment
          --- In caplet@yahoogroups.com, "Freeman, Tim" <tim.freeman@...> wrote:
          >
          > Care to post a citation for the Firefox[-6] bug? Google doesn't do a very good job searching for [-6]. Sounds pretty bizarre, if -1, -3, and -6 are special.


          https://bugzilla.mozilla.org/show_bug.cgi?id=507453

          http://www.thespanner.co.uk/2009/07/14/hidden-firefox-properties-revisited/
        • Brendan Eich
          ... So, fixed in Firefox 3.5 and 3.6 patch releases. Firefox 4 is out already. Is anyone seeing hits from downrev Firefoxes? /be_._,___
          Message 4 of 5 , Apr 19 10:58 AM
          View Source
          • 0 Attachment
            On Apr 19, 2011, at 9:13 AM, Douglas Crockford wrote:

             

            --- In caplet@yahoogroups.com, "Freeman, Tim" <tim.freeman@...> wrote:
            >
            > Care to post a citation for the Firefox[-6] bug? Google doesn't do a very good job searching for [-6]. Sounds pretty bizarre, if -1, -3, and -6 are special.

            https://bugzilla.mozilla.org/show_bug.cgi?id=507453


            So, fixed in Firefox 3.5 and 3.6 patch releases. Firefox 4 is out already. Is anyone seeing hits from downrev Firefoxes?

            /be_._,___

          • Douglas Crockford
            ... This is the Firefox distribution I see at Yahoo: 4.0 1.60% 3.6 21.78% 3.5 2.99% 3.0 1.93% 2.0 0.39%
            Message 5 of 5 , Apr 19 1:37 PM
            View Source
            • 0 Attachment
              --- In caplet@yahoogroups.com, Brendan Eich <brendan@...> wrote:
              >
              > On Apr 19, 2011, at 9:13 AM, Douglas Crockford wrote:
              >
              > > --- In caplet@yahoogroups.com, "Freeman, Tim" <tim.freeman@> wrote:
              > > >
              > > > Care to post a citation for the Firefox[-6] bug? Google doesn't do a very good job searching for [-6]. Sounds pretty bizarre, if -1, -3, and -6 are special.
              > >
              > > https://bugzilla.mozilla.org/show_bug.cgi?id=507453
              > >
              >
              > So, fixed in Firefox 3.5 and 3.6 patch releases. Firefox 4 is out already. Is anyone seeing hits from downrev Firefoxes?


              This is the Firefox distribution I see at Yahoo:

              4.0 1.60%
              3.6 21.78%
              3.5 2.99%
              3.0 1.93%
              2.0 0.39%
            Your message has been successfully submitted and would be delivered to recipients shortly.