Identifying "Do Not Track" preferences exclusively in Internet Explorer 11 using Javascript

Is there a way to respect the Do Not Track (DNT) settings in all browsers using only JavaScript? I do not have access to server-side code on the host server. I found the following solution on Stack Overflow:

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

This method works in most browsers, but I encountered issues with IE11 (specifically version 11.0.9600.16428 when run through Spoon.net), as it does not seem to recognize any of the DNT properties mentioned above. I tried changing the DNT preference through Internet Options > Advanced > Security ("Always send a Do Not Track header") and via Safety > Turn on tracking protection.

Can anyone confirm if this is a bug in IE11 or suggest an alternative JavaScript-only approach to detect these settings?

Thanks in advance, Ben

Answer №1

According to a Microsoft statement: "The standard has been updated" in IE11, moving the doNotTrack property to the window object.

As of now, only IE11 and Safari 6.1.1+ have implemented this update as shown in this window properties chart.

There is currently a debate/discussion from Mozilla on whether doNotTrack should be a window or navigator property.

Answer №2

If you haven't already, give a shot to

window.external.msTrackingProtectionEnabled()
. This function provides a boolean value and is functional in IE 9/10. While I'm unable to verify at the moment, it's likely compatible with IE 11 as well.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

"Unexpected error: .jqm is not defined as a

Having an issue with a jqm function that I need help with. <span class="smaller gray">[ <span class="blueonly"><a href="javascript:void(0)" rel="nofollow" onclick="javascript:jQuery(\'#s ...

Transmit the map via res.send in Express

My friend and I are collaborating on a game project, but we're encountering an issue when trying to send a Map with some data in it. Instead of receiving the actual Map, Express is sending the user {}. Strangely enough, when I use console.log to check ...

Facing an issue with displaying a component error in a mat-form-field in Angular 9

I am looking to develop a shared component for displaying errors in Angular Material. Here is my shared component pfa-share-error: <mat-error *ngIf="fieldErrors(fieldName).required && fieldErrors(fieldName)"> Required </mat-err ...

I'm struggling to grasp the reason behind the error message stating that x is not a function

Can someone help explain why I keep getting the error message "5Style is not a function"? NationalLevelCategoriesChosenList = [ ["5Style", "5MelodyHarmony", "5RhythmTempo", "5TextureStructureForm", "5Timbre"] ], [ [] ]; if (NationalLevelCategoriesC ...

Enhancing User Experience with React Hover Effects

I'm currently in the process of developing a React component library, and I'm looking to enhance the components with some stylish flair. Everything seems to be working smoothly, but I'm interested in changing the background color when a user ...

Tips for implementing i18n translation for a specific text variable in Vuejs

Typically, we simply assign the translation property to a variable like : this.name = this.$t('language.name'); However, there may be cases where we want to specify it in a specific language (e.g. French). Is there a way to achieve this in vue.j ...

How can we translate HTML entities generated by json_encode into matching XML conventions?

As I embark on the journey of creating a Samsung TV App, I find myself working within a strict system that only allows me to use JS and HTML5. One of the challenges I face is the need to send a JSON request to my web server to retrieve data for the emulato ...

Unable to detect the click event on Bootstrap accordion

I am currently utilizing Bootstrap to populate a table with data and then attempting to capture an accordion show event. My intention is to extract the div id in order to make an ajax call for more information on the respective item. Unfortunately, I have ...

Verifying updates in the watchlist once data has been initialized upon mounting

When trying to edit a component, the data is loaded with mounted in the following way: mounted () { var sectionKey = this.$store.getters.getCurrentEditionKey this.table = _.clone(this.$store.getters.getDocumentAttributes[sectionKey]) this.ta ...

After a certain time has passed, an event will occur once a div element has been assigned

Is there a way to show div2 only after div1 has been given the '.selected' class for a set duration, and then hide it again when div1 loses the '.selected' class? What would be the most efficient approach to achieve this? ...

Reacting with Angulatory: Response heads are not being transferred in applications

I'm facing an issue where the cookie containing my authentication token doesn't get passed along with my requests. After authenticating in Chrome, the response sets the cookie correctly, but it's not included in subsequent requests. This is ...

import the AJAX response into a table format

With over 10000 rows in Data-table 1.10, I am looking to populate the table body using ajax response. Currently, I am returning the data as an array and iterating over it on the frontend in HTML. This results in the data-table rendering all the rows regard ...

The onclick function is malfunctioning within the Node.js environment

Having trouble with Node.js not working with JavaScript code This is my File structure: app.js index.html index.js However, when I run it without Node, it works and the alert shows up. app.js var http = require('http'); var fs = require(&apo ...

Is it possible to incorporate custom scripts into the <head> section of the index.html file in Docusaurus?

I decided to organize my code by creating a scripts folder within the static directory. Inside this folder, I added a custom JavaScript file named "GetLocation.js". The path to this file is project/website/static/scripts/GetLocation.js Upon looking into s ...

What is the best way to add style to the title attribute of a dropdown menu item?

In my webform project, I have implemented a dropdown menu with custom tooltips for the list items. These tooltips are different from the display field and value field, which can be considered as the third column. To bind the tooltips to the list items usin ...

modify the values of directive elements using a templateUrl

HTML Template: I have an element in the template file seats.tpl.html like this: <select id="guest_table"> <option tables="emptySeats" ng-repeat="table in emptySeats" value="{{table.tableId}}">{{table.tableNumber}}</option& ...

Ensuring Bootstrap retains fullscreen tables while adjusting window size

I have set up a webpage containing a table and a footer. Utilizing bootstrap, I ensured that the footer remains visible while the table adjusts its height based on the remaining space on the screen. While this resizing works perfectly when the window size ...

Merge arrays to form nested structures

Here's a mind-bending scenario for you. Imagine I have two arrays - one containing categories and the other containing arrays that follow the structure of those categories. For example: var categoryArray = ["Name", "Title", "Hire Date"]; var infoArr ...

Obtain an array containing only unique values from a combination of arrays

Is there a simple way or plugin that can help me combine values from multiple arrays into one new array without duplicates? var x = { "12": [3, 4], "13": [3], "14": [1, 4] }; The resulting array should only contain unique values: [1, 3, 4]; ...

Troubleshooting focus loss in React input fields within a Datatable component implemented in a

I noticed an issue with my Datatable where the input field loses focus whenever I type a character and define the component inside another component. Surprisingly, when I directly place the component in the datatable, it works perfectly fine. I understand ...