svn commit: r41848 - head/en_US.ISO8859-1/htdocs/layout/js

Hiroki Sato hrs at FreeBSD.org
Fri Jun 7 22:44:56 UTC 2013


Tom Rhodes <trhodes at FreeBSD.org> wrote
  in <20130607113436.4dc1cbc3.trhodes at FreeBSD.org>:

tr> On Fri, 07 Jun 2013 09:25:34 +0900 (JST)
tr> Hiroki Sato <hrs at FreeBSD.org> wrote:
tr>
tr> > Eitan Adler <eadler at freebsd.org> wrote
tr> >   in <CAF6rxg=tnyCyLP50RpO8j20jbnGO_Mycb7aq5P3pRVz9NtvokA at mail.gmail.com>:
tr> >
tr> > ea> On 6 June 2013 16:28, Hiroki Sato <hrs at freebsd.org> wrote:
tr> > ea> >
tr> > ea> >  null, "", and undefined are evaluated as false in Javascript.
tr> > ea> >
tr> > ea> Javascript has an odd concept of true and false:
tr> > ea> null, an empty string,  +0, -0, and NaN, and false are the 'false' values.
tr> > ea>
tr> > ea> An object will return true.
tr> >
tr> >  I see.  I am not familiar with DNT implementation, but is there a www
tr> >  browser to define navigator.doNotTrack as the value "false"?
tr> >
tr> >  If so, I think something like the following is needed.
tr> >
tr> >  var dnt = window.navigator.msDoNotTrack || window.navigator.doNotTrack;
tr> >  var allow_track = (dnt && dnt == 'yes'|| dnt == 1);
tr> >
tr> > -- Hiroki
tr> >
tr>
tr> I was assuming based on the discussion that we need to perform
tr> more than a single check on this, but will this one actually
tr> work?  It just looks odd to me.  Note: Not a js guy either.

 I confirmed it works on the browsers.  In my understanding, we have
 to check if the object is defined, then it is "1" or "yes", and
 otherwise consider DNT is not enabled.  I agree that checking if it
 is true or not is wrong as Eitan says.

-- Hiroki
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-doc-all/attachments/20130608/18136e58/attachment.sig>


More information about the svn-doc-all mailing list