Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xxczaki/is-dnt
🕵️ Check whether the Do not track (DNT) policy is enabled in user's browser or not
https://github.com/xxczaki/is-dnt
browser browsers chrome detection dnt do-not-track do-not-track-policy edge firefox ie internet-explorer internet-explorer-6 is-dnt js npm opera privacy respect-privacy safari settings
Last synced: about 2 months ago
JSON representation
🕵️ Check whether the Do not track (DNT) policy is enabled in user's browser or not
- Host: GitHub
- URL: https://github.com/xxczaki/is-dnt
- Owner: xxczaki
- License: mit
- Created: 2019-06-11T19:01:25.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-08-01T22:29:16.000Z (over 5 years ago)
- Last Synced: 2024-11-16T01:20:30.391Z (about 2 months ago)
- Topics: browser, browsers, chrome, detection, dnt, do-not-track, do-not-track-policy, edge, firefox, ie, internet-explorer, internet-explorer-6, is-dnt, js, npm, opera, privacy, respect-privacy, safari, settings
- Language: TypeScript
- Size: 20.5 KB
- Stars: 7
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: .github/funding.yml
- License: LICENSE
Awesome Lists containing this project
README
# is-dnt [![Build Status](https://travis-ci.org/xxczaki/is-dnt.svg?branch=master)](https://travis-ci.org/xxczaki/is-dnt) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo)
> 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
```js
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](https://github.com/corbindavenport) in his [How to correctly check for Do Not Track with JavaScript](https://dev.to/corbindavenport/how-to-correctly-check-for-do-not-track-with-javascript-135d) post.
## License
MIT © [Antoni Kepinski](https://kepinski.me)