I would like to respect the DNT settings in all browsers using only javascript (I don't have server side access to the host server). I got the following from https://stackoverflow.com/a/16947583/266960
var isDNT = navigator.doNotTrack == "yes" || navigator.doNotTrack == "1" || navigator.msDoNotTrack == "1";
This works in all browsers but IE11 (specifically 11.0.9600.16428 run through [http://spoon.net/]), which does not seem to honour any of the above BOM properties (I tried setting the DNT preference via the Internet Options > Advanced > Security: "Always send a do not track header" and also via Safety > Turn on tracking protection).
Can anyone else confirm this is correct (i.e. a bug in IE11), or suggest a JS only method to detect those settings?
TIA Ben
As per this answer from Microsoft: "The standard was updated" as of IE11, placing the doNotTrack property on the window object instead.
Not all browsers are up to date with this yet, only IE11 and Safari 6.1.1+ have updated at this time as per this window properties table.
As of this writing there is a current disagreement/discussion from Mozilla as to whether doNotTrack should be a window or navigator property.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With