/is-dnt

🕵️ Check whether the Do not track (DNT) policy is enabled in user's browser or not

Primary LanguageTypeScriptMIT LicenseMIT

is-dnt Build Status XO code style

Check whether the Do not track (DNT) policy is enabled in user's browser or not

Highlights

  • Supports all major browsers (from Internet Explorer 6)
  • 0 dependencies
  • Written in TypeScript

Install

$ npm install is-dnt

Usage

const isDnt = require('is-dnt');

isDnt(); //=> true

API

isDnt()

Returns a boolean of whether the Do not track policy is enabled and undefined if the browser does not support DNT.

Notice

This package uses the solution described by Corbin Davenport in his How to correctly check for Do Not Track with JavaScript post.

License

MIT © Antoni Kepinski