GithubHelp home page GithubHelp logo

kkoooqq / fakebrowser Goto Github PK

View Code? Open in Web Editor NEW
1.1K 1.1K 212.0 29.62 MB

🤖 Fake fingerprints to bypass anti-bot systems. Simulate mouse and keyboard operations to make behavior like a real person.

License: GNU Lesser General Public License v3.0

TypeScript 30.42% JavaScript 69.22% HTML 0.20% Shell 0.16%
anti-bot-detection anti-fingerprinting automation bot browser-fingerprint cheat crawler fake headless puppeteer puppeteer-extra puppeteer-extra-plugin scrapy spoof stealth

fakebrowser's People

Contributors

analtevs avatar kkoooqq avatar rumatoid avatar soulkirito avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fakebrowser's Issues

Quickstart Guide

Hey, can someone provide a quick start guide for this project?
So far I've compiled the code
npm run build
Then copied the lib folder into my project. After that, I'm trying to start FakeBrowser:

import { FakeBrowserBuilder } from "./lib/fakebrowser/FakeBrowser";
(async () => {
	const fakeBrowser = new FakeBrowserBuilder();
	const browser = await fakeBrowser.launch();
})();

but it's giving me an error:

[INFO] 01:41:16 ts-node-dev ver. 1.1.8 (using ts-node ver. 9.1.1, typescript ver. 4.4.4)
(node:7344) UnhandledPromiseRejectionWarning: AssertionError [ERR_ASSERTION]: undefined == true  
at FakeBrowserBuilder.<anonymous> (D:\Projects\test\src\lib\fakebrowser\FakeBrowser.js:35:29)
at step (D:\Projects\test\src\lib\fakebrowser\FakeBrowser.js:33:23)
at Object.next (D:\Projects\test\src\lib\fakebrowser\FakeBrowser.js:14:53)
at D:\Projects\test\src\lib\fakebrowser\FakeBrowser.js:8:71
at new Promise (<anonymous>)
at __awaiter (D:\Projects\test\src\lib\fakebrowser\FakeBrowser.js:4:12)
at FakeBrowserBuilder.launch (D:\Projects\test\src\lib\fakebrowser\FakeBrowser.js:70:16)     
at D:\Projects\test\src\main.ts:5:36
at step (D:\Projects\test\src\main.ts:33:23)
at Object.next (D:\Projects\test\src\main.ts:14:53)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:7344) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise 
which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:7344) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero 
exit code.

SOCKS5 proxy with auth

Socks5 proxy dont work with fake browser:

Error: net::ERR_SOCKS_CONNECTION_FAILED at https://abrahamjuliot.github.io/creepjs/
    at navigate (C:\Users\eureq\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:155:23)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async FrameManager.navigateFrame (C:\Users\eureq\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:
130:21)
    at async Frame.goto (C:\Users\eureq\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:500:16)
    at async Page.goto (C:\Users\eureq\node_modules\puppeteer\lib\cjs\puppeteer\common\Page.js:1167:16)

But http proxy with auth works absolutely fine

Usage Guide

Hey, If you don't mind can you please provide some instructions on how to use this project?

ERR_TOO_MANY_REDIRECTS

I am trying to run demo3-fake-user-action.js and it outputs :

This instance has been shutdown and turned into a zombie.
(node:39241) UnhandledPromiseRejectionWarning: Error: net::ERR_TOO_MANY_REDIRECTS at https://google.com/
    at navigate (/home/pcb/Desktop/tools/fakebrowser/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:155:23)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async FrameManager.navigateFrame (/home/pcb/Desktop/tools/fakebrowser/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:130:21)
    at async Frame.goto (/home/pcb/Desktop/tools/fakebrowser/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:500:16)
    at async Page.goto (/home/pcb/Desktop/tools/fakebrowser/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:1167:16)
    at async /home/pcb/Desktop/tools/fakebrowser/fakebrowser/demo/demo3-fake-user-action.js:16:9
(node:39241) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:39241) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

what am I doing wrong ?
Thanks in advance

--disable-web-security and permissions

I have to dont use --disable-web-security, and I got error

VM6039:4 Uncaught DOMException: Blocked a frame with origin

Because of

const isSecure = 'undefined' == typeof window ? true : window.top.document.location.protocol.startsWith('https');

in src\plugins\evasions\navigator.permissions\index.js

You can use CDP function to spoof permissions

let permissions = {
    accelerometer: 'granted',
    camera: 'prompt',
    'clipboard-read': 'prompt',
    'clipboard-write': 'granted',
    geolocation: 'prompt',
    'background-sync': 'granted',
    magnetometer: 'granted',
    microphone: 'prompt',
    midi: 'granted',
    notifications: 'prompt',
    'payment-handler': 'granted',
    'persistent-storage': 'prompt',
  };

  for (let permission in permissions) {
    await page._client.send('Browser.setPermission', {
      permission: { name: permission },
      setting: permissions[permission],
    });
  }

PS Sorry for my English

demo for mobile

直接用 demo 里面的 iPhone 配置文件 device-hub-demo/iPhone.json,会报错。
定位在 node_modules\fakebrowser\dist\cjs\DeviceDescriptor.js:75:22 这里。
TypeError: Cannot read properties of undefined (reading 'innerHeight')

我用 dumpDD.jsiphone 真机上跑出来的数据,还是报错。
Error: Only chrome kernel browsers are supported

net::ERR_SOCKS_CONNECTION_FAILED

I've tried to use multiple socks5 proxies but to no avail.

Error:

Error: net::ERR_SOCKS_CONNECTION_FAILED at https://whatsmyip.com
    at navigate (Z:\Coding\fb\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:155:23)
    at processTicksAndRejections (node:internal/process/task_queues:93:5)
    at async FrameManager.navigateFrame (Z:\Coding\fb\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:130:21)
    at async Frame.goto (Z:\Coding\fb\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:500:16)
    at async Page.goto (Z:\Coding\fb\node_modules\puppeteer\lib\cjs\puppeteer\common\Page.js:1167:16)
    at async Z:\Coding\fb\index.js:39:5

max call stack size exceeded

when I run this for a very long time, 10 seconds start 1 instance ,every instance run about 2 minutes and use function shutdown() to close. and I always get this error. RangeError: Maximum call stack size exceeded . It located at node_modules\fakebrowser\dist\cjs\FakeBrowser.js:308

image

image

windows server 2019
nodejs 16.13.1

thoughts on collecting additional device fingerprints

I wanted to make a note of this before I forget

We can leverage device farms for creating fingerprint database / set.
Because we can opt for real devices and would have hundreds to select from (not to mention a simple framework) creating and regenerating profiles from ddump shouldn't be an issue. When I get some free time this week I do plan on doing this.
(on a side note - i do believe one of these providers also has a desktop farm in addition to the device farm. additional profiles could be had there too)

Any thoughts on this route?

example resources:

  1. https://aws.amazon.com/device-farm/
  2. https://firebase.google.com/docs/test-lab
  3. https://bitbar.com/real-devices-app-testing/

Hook specific page only

Is it possible to hook specific page only? For example, the hooked page navigate me to another page with different URL, can I "turn off" all the hooks and act like the particular page runs on normal browser?

TODO

TODO

DEPLOYMENTS

  • Supports Serverless
  • Supports docker & k8s
  • Upload more DDs

BUG

  • Touch screen device simulates user operation
  • After setting the referer, sec-fetch-site, it is impossible to bypass the risk control
  • accept-language not works well in headless
  • simulate macOS dd in Windows system.
  • page.mouse.move runs slowly in windows
  • handle window.open

OPTIMIZE

Cannot set plugins

I set up plugins.
But it doesn't seem to work.
The default content is also used. You can have a look.

navigator.plugins

Changing browser lang / ua ?

Hello, in puppteer-extra I can easily use user-agent-override evasion to set browser ua/lang before launch.
I was trying something as shown in example at https://github.com/kkoooqq/fakebrowser/blob/main/src/plugins/evasions/user-agent-override/index.js
but when I was trying to use it like FakeBrowser.use() / builder.use()

It was giving me errors:

TypeError: FakeBrowser.use is not a function
TypeError: builder.use is not a function

How is that possible in fakebrowser?

Unexpected token '||='

I got error in node_modules\fakebrowser\dist\cjs\Driver.js:182
outerWidth ||= innerWidth;

Error launching fakebrowser

Trying to run the demo on windows I'm getting the following error.

node_modules\fakebrowser\dist\plugins\evasions\navigator.plugins-native\index.js:46
fakePlugins: this.opts.fakeDD.plugins,
^

chrome args

How I can dont to use kDefaultLaunchArgs?

Cannot find module 'express'

I got error after npm im to fix this I have to install express manually

Error: Cannot find module 'express'
Require stack:
F:\Puppeteer\node_modules\fakebrowser\dist\cjs\FakeBrowser.js

UnhandledPromiseRejectionWarning: ProtocolError: Protocol error (Target.setAutoAttach): Target closed.

Hi

const {FakeBrowser} = require('fakebrowser');

!(async () => {
    // Change internal httpserver port number
    FakeBrowser.globalConfig.internalHttpServerPort = 17312

    const builder = new FakeBrowser.Builder()
        .displayUserActionLayer(true)
        .vanillaLaunchOptions({
            headless: false,
            executablePath: '/usr/bin/google-chrome-stable',
        })
        .userDataDir('./fakeBrowserUserData5');

    const fakeBrowser = await builder.launch();
    
    const page = await fakeBrowser.vanillaBrowser.newPage();
    await page.goto('https://whoer.net');
	

    // ***** Do something automatic *****

    // Don't forget to close your browser to release resources
  await fakeBrowser.shutdown();
})();

node demo.js

(node:2038) UnhandledPromiseRejectionWarning: ProtocolError: Protocol error (Target.setAutoAttach): Target closed.
    at /fakebrowser/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:226:24
    at new Promise (<anonymous>)
    at CDPSession.send (/fakebrowser/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:222:16)
    at Page._initialize (/fakebrowser/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:177:26)
    at Function.create (/fakebrowser/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:169:20)
    at /fakebrowser/node_modules/puppeteer/lib/cjs/puppeteer/common/Target.js:73:88
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Promise.all (index 0)
    at async BrowserContext.pages (/fakebrowser/node_modules/puppeteer/lib/cjs/puppeteer/common/Browser.js:461:23)
    at async Promise.all (index 0)
(node:2038) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:2038) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:2038) UnhandledPromiseRejectionWarning: AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:

  (0, assert_1.strict)(browserIndex >= 0)

    at Function._forceShutdown (/fakebrowser/node_modules/fakebrowser/dist/cjs/BrowserLauncher.js:199:29)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async FakeBrowser.shutdown (/fakebrowser/node_modules/fakebrowser/dist/cjs/FakeBrowser.js:174:13)
(node:2038) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)

node --unhandled-rejections=strict demo.js

/fakebrowser/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:226
                error: new Errors_js_1.ProtocolError(),
                       ^

ProtocolError: Protocol error (Target.setAutoAttach): Target closed.
    at /fakebrowser/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:226:24
    at new Promise (<anonymous>)
    at CDPSession.send (/fakebrowser/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:222:16)
    at Page._initialize (/fakebrowser/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:177:26)
    at Function.create (/fakebrowser/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:169:20)
    at /fakebrowser/node_modules/puppeteer/lib/cjs/puppeteer/common/Target.js:73:88
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Promise.all (index 0)
    at async BrowserContext.pages (/fakebrowser/node_modules/puppeteer/lib/cjs/puppeteer/common/Browser.js:461:23)
    at async Promise.all (index 0) {
  originalMessage: undefined
}

Run on linux.

node --version
v12.22.5
{
"dependencies": {
"axios": "^0.24.0",
"fakebrowser": "0.0.55",
"puppeteer": "^11.0.0"
}
}

WebGl strange

I run some test with difference DD but https://bot.sannysoft.com/ not show WebGL Vendor/Renderer

webgl-not-show-here
but it show inside fp collect info
fp-collect-info-show
Also some field Plugins is of type PluginArray + Languages + Hairline Feature + Broken Image Dimensions in first image

Enable Cookies

I want to keep login into account for specified path like one youtube account in /FakeBrowser1 profile and second account in /FakeBrowser2

[Question]: onServiceWorkerContent(jsContent)

I am new to puppeter. Thanks for sharing this project, its a great one.
I found function 'onServiceWorkerContent(jsContent)' in some plugins file, but I didnt see any class calling it anywhere.
I wish you can provide a small example, to show that how to patch ServiceWorker with this function,
it may solve some of my problems.

ERR_TOO_MANY_REDIRECTS

ERR_TOO_MANY_REDIRECTS error occurs when opening google.com or youtube.com with a proxy.
The problem is not observed when using the original puppeteer and puppeteer-extra, also when using fakebrowser without a proxy.

new FakeBrowser.Builder()
      .evasionPaths([])
      .usePlugins([])
      .vanillaLaunchOptions({
        headless: false
      })
      .proxy({
        proxyType: 'https',
        proxy: `${this.$config.proxy.host}:${this.$config.proxy.port}`,
        exportIP: this.$config.proxy.host,
        username: this.$config.proxy.username,
        password: this.$config.proxy.password
      })
      .userDataDir(config.userDataDir);

Cannot login gmail

Couldn’t sign you in
This browser or app may not be secure. Learn more
Try using a different browser. If you’re already using a supported browser, you can try again to sign in.

Cannot launch two chromium instances in single docker container

Hi! I'm having an issue with running several bots in one docker container simultaneously. The first bot starts successfully, but when I'm trying to start another bot this error pops up:

(node:4057) UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process!
[4923:4963:0209/171529.968614:ERROR:bus.cc(396)] Failed to connect to the bus: An AppArmor policy prevents this sender from sending this message to this recipient; type="method_call", sender="(null)" (in>
[4983:4983:0209/171530.593904:ERROR:viz_main_impl.cc(169)] Exiting GPU process due to errors during initialization


TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

    at onClose (/var/www/app/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:229:20)
    at Interface.<anonymous> (/var/www/app/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:219:68)
    at Interface.emit (events.js:326:22)
    at Interface.close (readline.js:416:8)
    at Socket.onend (readline.js:194:10)
    at Socket.emit (events.js:326:22)
    at endReadableNT (_stream_readable.js:1241:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
(node:4057) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was >
(node:4057) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code

Node v12.22.9
OS(in container): Debian 9.13
My dockerfile:

FROM node:12

RUN apt-get update \
    && apt-get install -y dbus-x11 software-properties-common wget gnupg \
    && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
    && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
    && apt-get update \
    && apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \
      --no-install-recommends \
    && rm -rf /var/lib/apt/lists/*

RUN apt-get update && apt-get install -yq gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libatk-bridge2.0-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget x11vnc x11-xkb-utils xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic x11-apps xvfb

RUN mkdir -p /var/www/app
WORKDIR /var/www/app

# Install app dependencies
COPY package.json .
RUN npm install
RUN npm i concurrently -g
RUN npm i nodemon -g

RUN apt install chromium -y \
    && apt-get update \
    && apt install chromium -y

ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
    PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium

# Install puppeteer so it's available in the container.
RUN npm init -y &&  \
    npm i puppeteer \
    # Add user so we don't need --no-sandbox.
    # same layer as npm install to keep re-chowned files from using up several hundred MBs more space
    && groupadd -r pptruser && useradd -r -g pptruser -G audio,video pptruser \
    && mkdir -p /home/pptruser/Downloads \
    && chown -R pptruser:pptruser /home/pptruser \
    && chown -R pptruser:pptruser ./node_modules \
    && chown -R pptruser:pptruser ./package.json \
    && chown -R pptruser:pptruser ./package-lock.json 

# Run everything after as non-privileged user.
# USER pptruser

# Bundle app source
COPY . .

ENV PATH="${PATH}:./node_modules/.bin"
ENV DISPLAY :99

CMD ["bash", "/var/www/app/entrypoint.sh"]

launcher.js :

const options = {
        headless: false,
        devtools: false,
        ignoreHTTPSErrors: true,
        args: [
            `--no-sandbox`,
            `--disable-setuid-sandbox`,
            `--ignore-certificate-errors`
        ]
};
const browser = await puppeteer.launch(options);
const browserWSEndpoint = await browser.wsEndpoint();
console.log("browserWSEndpoint----- :> ", browserWSEndpoint);
await browser.disconnect();
 return browserWSEndpoint;

index.js:

FakeBrowser.globalConfig.internalHttpServerPort = getRandomInt(17300, 17400);
let WSEndPoint = await launcher();
console.log("WSENDPOINT :", WSEndPoint);
const builder = new FakeBrowser.Builder()
            .displayUserActionLayer(true)
            .proxy({
                proxy: `http://${this.proxy.ip}:${this.proxy.port}`,
                exportIP: this.proxy.ip,
                username: this.proxy.login,
                password: this.proxy.password
            })
            .vanillaLaunchOptions({
                headless: false,
                pipe: false,
                browserWSEndpoint: WSEndPoint,
                args: [
                    "--disable-setuid-sandbox",
                    "--no-sandbox",
                ],
            })
            .userDataDir(`/${pathToApp}/data/fingerprints/${this.user.id}`);
this.browser = await builder.launch();

Thanks in advance!

UnhandledPromiseRejectionWarning: Unable to get active page

Hi.

Example not working

const {FakeBrowser} = require('fakebrowser');

!(async () => {
    const createBrowserAndGoto = async (userDataDir) => {
              const dd = require('./node_modules/fakebrowser/device-hub-demo/Windows.json');
          
                const builder = new FakeBrowser.Builder()

	    .deviceDescriptor(dd)
            .vanillaLaunchOptions({

                headless: false,
                executablePath:'/usr/bin/google-chrome-stable',  
            })
            .userDataDir(userDataDir);

            
		const fakeBrowser = await builder.launch();
		var getPages = await fakeBrowser.getActivePage();
		await getPages.goto('https://example.org/');

		await sleep(20000);
		await getPages.close()

    };

    createBrowserAndGoto('./fakeBrowserUserData').then(e => e);
})();

Call fakeBrowser.getActivePage(); not return default page.

Example working only puppeteer;

'use strict';

const puppeteer = require('puppeteer');

function sleep(millis) {
    return new Promise(resolve => setTimeout(resolve, millis));
}

(async function main() {
  try {
    const browser = await puppeteer.launch({
		headless: false, 
		executablePath: '/usr/bin/google-chrome-stable',
		});
    const [page] = await browser.pages();
	
    await page.goto('https://example.org/');

    console.log(page.url());
    console.log(typeof page.url());

	await sleep(20000);

    await page.close()

  } catch (err) {
    console.error(err);
  }
})();

Call await browser.pages(); return default page;

fingerprint always the same

Great job!
fakebrowser like a true browser.

fakebrowser always the same fingerprint.
I saw plugins path has fingerprint file. how do fakebrowser use it? which method use

thanks a lot

userAction.simClickElement not work in headless mode

I use userAction.simClickElement and it's very smooth in my code with headless false.
but when I change headless to true , the program will be blocked in userAction.simClickElement line .

e.g.

console.log('start')
const loginPass = await page.$('#npwd');
await userAction.simClickElement(loginPass); // will be blocked in here 
console.log('end') // never tick with  headless:true

userAction封装的方法,在headless为true情况下,会一直卡着?

Error: Cannot find module 'lodash'

Macbooks-MacBook-Pro:reg_account macbookpro$ node index.js
(node:56955) UnhandledPromiseRejectionWarning: Error: Cannot find module 'lodash'
Require stack:

  • /Users/macbookpro/Desktop/Users/source-code/reg_account/node_modules/fakebrowser/dist/cjs/plugins/evasions/user-agent-override/index.js
  • /Users/macbookpro/Desktop/Users/source-code/reg_account/node_modules/fakebrowser/dist/cjs/PptrPatcher.js
  • /Users/macbookpro/Desktop/Users/source-code/reg_account/node_modules/fakebrowser/dist/cjs/Driver.js
  • /Users/macbookpro/Desktop/Users/source-code/reg_account/node_modules/fakebrowser/dist/cjs/FakeBrowser.js
  • /Users/macbookpro/Desktop/Users/source-code/reg_account/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object. (/Users/macbookpro/Desktop/Users/source-code/reg_account/node_modules/fakebrowser/dist/cjs/plugins/evasions/user-agent-override/index.js:7:16)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    (Use node --trace-warnings ... to show where the warning was created)
    (node:56955) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
    (node:56955) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

{
"dependencies": {
"axios": "^0.24.0",
"express": "^4.17.1",
"fakebrowser": "^0.0.40",
"puppeteer": "^10.4.0"
}
}

high priority TODO

  • optimizing default args
  • audio evasion
  • providing configured patches
  • dumping navigator.permissions from DD
  • doNotHook plug-ins when chrome > 93
  • bypass nike.com

dumpDD Android.json problem

Hi, I have a problem running using android.json.

I've tried dumpDD to 4 different real androids, but the dumpDD script results are always problematic.
I've tried dumpDD to windows, the results can run smoothly, but specifically for android there can't be run.
Please fix this problem for android.json. Thank You

image
image
image
image

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.