Javascript Only Detect Do Not Track Settings in IE11

I would like to respect DNT settings in all browsers using only javascript (I do not have access to the server server on the server). I got the following from https://stackoverflow.com/a/3129609/

var isDNT = navigator.doNotTrack == "yes" || navigator.doNotTrack == "1" || navigator.msDoNotTrack == "1"; 

This works in all browsers, but IE11 (in particular, 11.0.9600.16428 goes through [ http://spoon.net/] ), which does not seem to comply with any of the above specification properties (I tried to set the DNT preference using "Properties Browser ">" Advanced ">" Security ":" Always send the header do not track ", and also using" Security ">" Enable tracking protection ").

Can someone confirm this correctly (i.e. an error in IE11) or suggest a JS method to detect these parameters?

Tia Ben

+3
source share
2 answers

According to this answer from Microsoft : “The standard has been updated” with IE11 by placing the doNotTrack property in the window object.

Not all browsers have been updated so far, only IE11 and Safari 6.1.1+ have been updated at present according to this table of window properties .

At the time of this writing, there is ongoing disagreement / discussion in Mozilla about whether doNotTrack should be a window or navigator property.

+5
source

Have you tried with window.external.msTrackingProtectionEnabled() , which returns a boolean and is implemented in IE 9/10. I cannot check right now, but it is probably supported in IE 11 as well.

http://ie.microsoft.com/TEStdrive/Browser/DoNotTrack/Default.html

0
source

All Articles