2.0.4 • Published 25 days ago

3rd-cookie-check v2.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
25 days ago

3rd cookie check

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

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 messagehttps://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
2.0.4

25 days ago

2.0.3

26 days ago

2.0.2

26 days ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago