Code Monkey home page Code Monkey logo

Comments (1)

Fannovel16 avatar Fannovel16 commented on May 21, 2024

The simplest temporary way to fix this bug is using puppeteer-extra-plugin-stealth and playwright-extra.

const { chromium } = require('playwright-extra');
const { FingerprintGenerator } = require('fingerprint-generator');
const { FingerprintInjector } = require('fingerprint-injector');
const StealthPlugin = require('puppeteer-extra-plugin-stealth')
puppeteer.use(StealthPlugin());
const fingerprintGenerator = new FingerprintGenerator();
const fingerprintInjector = new FingerprintInjector();

((async () => {
  const fingerprint = fingerprintGenerator.getFingerprint({
    devices: ['desktop'],
    browsers: [{ name: "firefox", minVersion: 98 }, { name: 'chrome', minVersion: 98 }],
    locales: ["en-US"],
  });
  const ctx = await chromium.launchPersistentContext('./profile/', {
    headless: false,
    ignoreHTTPSErrors: true,
    viewport: null,
    userAgent: fingerprint.fingerprint.navigator.userAgent,
    locale: fingerprint.fingerprint.navigator.language,
  });
  await fingerprintInjector.attachFingerprintToPlaywright(ctx, fingerprint);
    
  const page = ctx.pages()[0];
  page.setDefaultNavigationTimeout(0);
  const navigationPromise = page.waitForNavigation({ waitUntil: "domcontentloaded", });
  await page.goto('https://accounts.google.com/signin/v2/identifier?flowName=GlifWebSignIn&flowEntry=ServiceLogin');
  await navigationPromise;
  await page.waitForSelector('input[type="email"]');
  await page.type('input[type="email"]', "your.email");
  await page.click("#identifierNext", { delay: 31 });
  await page.waitForSelector('input[type="password"]', { visible: true });
  await page.type('input[type="password"]', "your.password");
  await page.waitForSelector("#passwordNext", { visible: true });
  await page.click("#passwordNext");
  await navigationPromise;
})()

from fingerprint-suite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.