Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tpc-checker

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tpc-checker

simple script to check if browser supports third party cookies

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

A simple module to check if user browsers have third party cookies enabled.

Usage

Host the contents of the public folder in a publicly, externally accessible, HTTPS enabled place. Then install the package, and require it in your client code using your bundler of choice to use the function.

The checkTPC function takes the URL to wherever you're hosting the public folder, and an optional timeout in ms. It returns a promise that resolves true or false if TPCs are supported or not, and rejects if the check times out.

checkTPC(url: string, timeout?: number): Promise<boolean>

Example

import checkTPC from 'tpc-checker';

checkTPC(
	'https://wherever.you.put.public.contents/', // wherever you put the contents of /public
	5e3 // check timeout (5 seconds)
)
.then((supported)=>{
	if(supported){
		// third party cookies are working
	} else {
		// third party cookies are not supported
	}
})
.catch((error)=>{
	// check timed out
});

FAQs

Package last updated on 13 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc