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

puppeteer-afp

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

puppeteer-afp - npm Package Compare versions

Comparing version 1.1.1 to 1.1.3

2

package.json
{
"name": "puppeteer-afp",
"version": "1.1.1",
"version": "1.1.3",
"description": "Stop website fingerprinting techniques",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -5,6 +5,3 @@ # puppeteer-afp

This covers:
Canvas Fingerprinting
WebGL Fingerprinting
AudioContext Fingerprinting
Font Fingerprinting
Canvas Fingerprinting, WebGL Fingerprinting, AudioContext Fingerprinting, Font Fingerprinting

@@ -22,3 +19,6 @@ ## Installation

const puppeteer = require('puppeteer');
const puppeteerAfp = require('puppeteer-afp');
const {
protectPage,
protectedBrowser,
} = require('puppeteer-afp');

@@ -28,3 +28,4 @@ const browser = await puppeteer.launch();

const pageToProtect = (await browser.pages())[0];
// For these options, all are optional, and you dont have to use them, these are used just if you want to reuse a fingerprint
// For these options, all are optional, and you dont have to use them,
// these are used just if you want to reuse a fingerprint
const options = {

@@ -74,5 +75,12 @@ canvasRgba: [0, 0, 0, 0], //all these numbers can be from -5 to 5

};
// run this function on any page you want to protect, so pages loaded on this page after this is done will be protected
await puppeteerAfp(pageToProtect, options);
// run this function on any page you want to protect, so pages loaded on
// this page after this is done will be protected
await protectPage(pageToProtect, options);
//Another way of using it is to protect automatically a new tab,
//and if you want the fingerprint to change, just remove the options parameter:
const protectedChromium = await protectedBrowser(browser, options);
//and then we use the following command:
const protectedPage = protectedChromium.newProtectedPage()
```

@@ -79,0 +87,0 @@

@@ -7,3 +7,3 @@ 'use strict';

*/
module.exports = function (page, options = {}) {
const protectPage = (page, options = {}) => {

@@ -317,2 +317,17 @@ page.evaluateOnNewDocument(

return page;
};
const protectedBrowser = async (browser, options = {}) => {
const protectedBrowser = browser;
protectedBrowser.newProtectedPage = async () => {
const page = await browser.newPage();
await protectPage(page, options);
return page;
};
return protectedBrowser;
};
module.exports = {
protectPage,
protectedBrowser,
};
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