Catalog npm
Back to packageRELEASE DETAILS

2.0.3

npm

3rd-cookie-check

Check if current browser is blocking 3rd party cookies or not

cookie
Published13 Apr 2024
Direct dependencies5
Transitive dependenciesNot calculated

README

Current package documentation

NPM version Node.js CI NPM Weekly Downloads License

This is a library that help you check current browser support "Third party cookie" or not

cookie setting image

Issue 404 not found

For anyone encounter issue like this in version 2.0.0. Their are 2 solutions:

  1. Upgrade to latest version (current is 2.0.3).
  2. Pass below value to iframeSrc
cookieCheck({ 
    iframeSrc: 'https://davidtranjs.github.io/3rd-cookie-check/readcookie.html' 
}).then(function(result) {
    const { supported, timeout } = result;
    // Your code here
})

Checklist

  • Support safari
  • Add tested browser information

Installation

# npm
npm install --save 3rd-cookie-check`
# or yarn
yarn add 3rd-cookie-check

Usage

import cookieCheck from '3rd-cookie-check';

cookieCheck().then(function(result) {
    const { supported, timeout } = result;
    // Your code here
})

Parameters

cookieCheck(parametersObject)

All parameters is optional

ParamTypeDescribeDefault value
timeoutnumberTimeout in milisecond1000
eventCodeobject{ supported: string, unsupported: string }
Use this when use need to change the browser event message for third party cookie feature
{
  supported: "3pc.supported",
  unsupported: "3pc.unsupported" }
iframeSrcstringIn case you need to use your own page for check cookie
This URL domain must be difference from your app domain, this make sure browser fire third cookie event message
https://davidtranjs.github.io/3rd-cookie-check/checkpage.html

Return value

An Promise that resolve with a object have 2 properties:

  • supported - boolean - indicate browser support status. Return false if timeout
  • timeout - boolean - default false - true if timeout was triggered

Changes

1.0.1

  • First version of package

1.0.2

  • Fix not correct result response - Correct iframe src

2.0.0

  • Change returned object
  • Add support for custom iframe src with iframeSrc parameter

2.0.3

  • Change default iframeSrc as I changed my github username from dungmidside to davidtranjs

2.0.4

  • Correct default iframeSrc

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 5

Native requirements
5 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
prettier
Environment
{
  "local_name": "prettier",
  "alias": false,
  "peer_metadata": null
}
2.2.1development
ts-loader
Environment
{
  "local_name": "ts-loader",
  "alias": false,
  "peer_metadata": null
}
^9.1.2development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^4.2.4development
webpack
Environment
{
  "local_name": "webpack",
  "alias": false,
  "peer_metadata": null
}
^5.36.2development
webpack-cli
Environment
{
  "local_name": "webpack-cli",
  "alias": false,
  "peer_metadata": null
}
^4.7.0development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-zuxNpFZa/Bvxmu9ARGI/NOk0fBveyY+rxpOUhvGQOMWTH9+fGd1Fahntzkg6qW3ULoth8xEnL2wHbZr8jUHEag==",
  "shasum": "680b25930bcb79544e17ab04a14304b263f2dcca",
  "tarball": "https://registry.npmjs.org/3rd-cookie-check/-/3rd-cookie-check-2.0.3.tgz",
  "fileCount": 14,
  "unpackedSize": 75819,
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEQCIFuAprNE6lWCnDfzkZE5tRa5neO/KIyjOUNvbLdbLxR7AiBWGDLPLdVx7/ml4ufW6QsvOD5Tgy80AJStGOfJROc2iQ=="
    }
  ]
}

Repository

PENDING
dungmidside/3rd-cookie-check

Shared repository data · GitHub

License detected in repository
Not collected

Repository

PENDING
davidtranjs/3rd-cookie-check

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:51 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:841809267406b5a7940f8cfe06f1391dfc5fa01029ce88f92dbe1f48addbdcc3

Other collected versions

2.0.414 Apr2.0.213 Apr2.0.16 Jun2.0.015 May1.0.213 May1.0.19 MayView all collected versions →