In other words, the Node.js module system goes from “slightly deranged” to “very similar to Nix”. The modules can now be built without requiring their dependencies be part of the build. This is nice for disk space of course, but also for install speed and reproducibility, there’s a lot of hashing and caching going on. So I recently found out that yarn has a PnP mode which overrides Node.js’s standard resolution mechanism (to node_modules directories) and instead references a read-only compressed store of packages. an npm v2 lock file, you just put dream2nix in flake.nix and you’ll have a devshell and build with the correct modules, no extra step. A new addExtra export, to patch any puppeteer compatible library with plugin functionality ( chrome-aws-lambda, etc).UPDATE: dream2nix creates node_modules from the lock files directly, if the lock file has all the necessary info.That means out of the box type safety for fellow TS users and nice auto-completion in VSCode for JS users. Changelog 2.1.6 ➠ 3.1.1īig refactor, the core is now written in TypeScript □ the user-preferences plugin), look into xvfb-run if you still require a headless experience in these circumstances. We never broke compatibility and still support puppeteer down to very early versions from 2018.Ī few plugins won't work in headless mode (it's noted if that's the case) due to Chrome limitations (e.g. Puppeteer-extra and all plugins are tested continously in a matrix of current (stable & LTS) NodeJS and puppeteer versions. Thanks to transitive-bullshit for suggesting a modular plugin design, which was fun to implement.Thanks to skyiea for this PR that started the project idea.We use a monorepo powered by Lerna (and yarn workspaces), ava for testing, TypeScript for the core, the standard style for linting and JSDoc heavily to auto-generate markdown documentation based on code. Have a look the PuppeteerExtraPlugin base class documentation to get going and check out the existing plugins (minimal example is the anonymize-ua plugin) for reference. PRs and new plugins are welcome! □ The plugin API for puppeteer-extra is clean and fun to use. Please check the Contributing section below if you're interested in creating a plugin as well. Great for remotely intervening when an automated task gets stuck, like captchas.Use the Chromium screencast API to remotely view and interact with puppeteer sessions.Minimize and maximize puppeteer in real time.Please note that they're hosted outside the main project and not under our control or supervision. These plugins have been generously contributed by members of the community. puppeteer-extra-plugin-font-size.Ĭheck out the packages folder for more plugins. Has itself a plugin interface which is used by e.g.Allows setting custom Chrome/Chromium user preferences.Supports dynamic replacing, so the browser version stays intact and recent.Anonymizes the user-agent on all pages.Allows flash content to run on all sites without user interaction.Supports all resource types, blocking can be toggled dynamically.Blocks resources (images, media, css, etc.) in puppeteer.Makes quick puppeteer debugging and exploration fun with an interactive REPL.screencasting) accessible from the public internet Creates a secure tunnel to make the devtools frontend ( incl. ![]() Makes puppeteer browser debugging possible from anywhere.Very fast & efficient blocker for ads and trackers.Solves reCAPTCHAs and hCaptchas automatically, using a single line of code: page.solveRecaptchas().Applies various evasion techniques to make detection of puppeteer harder.e(AdblockerPlugin() Plugins □ puppeteer-extra-plugin-stealth Add adblocker plugin to block all ads and trackers (saves bandwidth)Ĭonst AdblockerPlugin = require('puppeteer-extra-plugin-adblocker') Add stealth plugin and use defaults (all tricks to hide puppeteer usage)Ĭonst StealthPlugin = require('puppeteer-extra-plugin-stealth') Any number of plugins can be added through `e()`Ĭonst puppeteer = require('puppeteer-extra') it augments the installed puppeteer with plugin functionality. Yarn add puppeteer-extra Quickstart // puppeteer-extra is a drop-in replacement for puppeteer, # puppeteer-extra works with any puppeteer version: Installation yarn add puppeteer puppeteer-extra A light-weight wrapper around puppeteer and friends to enable cool plugins through a clean interface.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |