3rd-cookie-check 中文文档教程

发布于 3年前 浏览 23 项目主页 更新于 3年前

3rd cookie check

 NPM 版本”></a> 
  <img src=  NPM 每周下载量  License

这是一个帮助您检查当前浏览器是否支持“第三方 cookie”的库

cookie setting image

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)

所有参数都是可选

Param Type Describe Default value
timeout number Timeout in milisecond 1000
eventCode object { supported: string, unsupported: string }
Use this when use need to change the browser event message for third party cookie feature
{<br/>&nbsp;&nbsp;supported: "3pc.supported", <br>&nbsp;&nbsp;unsupported: "3pc.unsupported" }
iframeSrc string In 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://dungmidside.github.io/3rd-cookie-check/checkpage.html

Return value

的 使用对象解析的 Promise 有 2 个属性:

  • 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

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

cookie setting image

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

Param Type Describe Default value
timeout number Timeout in milisecond 1000
eventCode object { supported: string, unsupported: string }
Use this when use need to change the browser event message for third party cookie feature
{<br/>&nbsp;&nbsp;supported: "3pc.supported", <br>&nbsp;&nbsp;unsupported: "3pc.unsupported" }
iframeSrc string In 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://dungmidside.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
更多

友情链接

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文