question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Run all Puppeteer commands in an Isolated World

See original GitHub issue

Attempting to address this issue below and looking for feedback and ideas on any potential ways to achieve this more cleanly: https://github.com/berstend/puppeteer-extra/issues/209

The goal is to have Puppeteer run every command in a Isolated Worlds to avoid detection scripts being able to monitor execution.

The concept write up is here (sorry, needed too much detail to include within the issue text): https://github.com/prescience-data/harden-puppeteer

The only way I can figure out how to achieve this is by modifying the vanilla Puppeteer files directly in the node_modules folder, so hoping someone with experience writing Puppteer-Extra plugins can advise a way to do with with a plugin instead.

Thanks!

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
prescience-datacommented, Aug 4, 2020

Ok so I can confirm that the patch works as intended.

I’ve made a test for it here that uses Vastel’s execution monitoring technique to figure out if the host site has any visibility into the patched context:

Puppeteer Test: https://github.com/prescience-data/puppeteer-botcheck/blob/b6848845b8b5887608784caa2fe7a078db866e9b/Botcheck.js#L45 Host Monitoring Execution: https://github.com/prescience-data/prescience-data.github.io/blob/master/execution-monitor.html

URL of the live test: https://prescience-data.github.io/execution-monitor.html

Here’s the differences between unpatched and patched:

Unpatched

Unpatched

Patched

Unpatched

You can see that the patched version only detects the inserted elements (which was left deliberately unisolated to allow user to inject scripts into the main context (ie all the extra-stealth modifications).

However, anything other than that is running isolated and outside the security scope of any bot detection script.

Naturally they would be able to observe changes you make to the DOM, but only the outcome, not how the execution is occurring.

1reaction
brunogasparcommented, Jun 11, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

What is the best way to run multiple instances of Node app at ...
For a "multi-threaded" Puppeteer app, consider using multiple BrowserContext objects, which should allow you to efficiently run Puppeteer ...
Read more >
End-to-End testing with Puppeteer and Jest - Medium
Let's run Puppeteer for the first time on it's own, so you will actually see how it works alone without Jest in the...
Read more >
Run end-to-end test with Jest and Puppeteer | Sanity.io guide
You'll start by installing Jest and Puppeteer in your project directory. Open the project in your cli and run the following commands.
Read more >
Running Services — Apptainer User Guide main documentation
This command causes Apptainer to create an isolated environment for the ... So make sure to run all instance commands either with or...
Read more >
browserless, the headless Chrome/Chromium performance ...
You can use it next to puppeteer , puppeteer-core or puppeteer-firefox , interchangeably. Usage. This is a full example for showcase all the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found