You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
KaKi87 3dd302fb77 📝 Fix 2c44490 missing 'Basic usage' section update 2 months ago
lib ♻️ Refactor 95e0fc2 'set' method 7 months ago
src 🐛 Fix d5b9697 6 months ago
.gitignore 🎉 Initial commit 12 months ago
DOCUMENTATION.md 📝 As per f01772e, f92a45f, 2c44490 6 months ago
README.md 📝 Fix 2c44490 missing 'Basic usage' section update 2 months ago
mod.js 🚚 Rename helper creation methods 6 months ago
package.json 🔨 Add 'docgen' script 6 months ago
yarn.lock 🎉 Initial commit 12 months ago

README.md

puppeteer-helpers

Documentation

Basic usage (using puppeteer)

const
    puppeteer = require('puppeteer'),
    {
        createBrowserHelper,
        createPageHelper,
    } = require('puppeteer-helpers');

(async () => {
    const
        myBrowser = await puppeteer.launch(),
        myBrowserHelper = createBrowserHelper(myBrowser),
        myPage = await myBrowserHelper.getDefaultPage(),
        myPageHelper = pageHelper(myPage);
})();

Advanced usage (using puppeteer-extra)

const
    puppeteer = require('puppeteer-extra'),
    {
        createBrowserHelper,
        createPageHelper,
        createUserPreferences
    } = require('puppeteer-helpers');

const myUserPreferences = createUserPreferences();
myUserPreferences.set(['webkit', 'webprefs', 'default_font_size'], 22);
myUserPreferences.setDevToolsDocked(false);
myUserPreferences.setDevToolsTheme('dark');
puppeteer.use(require('puppeteer-extra-plugin-user-preferences')(myUserPreferences.get()));

(async () => {
    const
        myBrowser = await puppeteer.launch(),
        myBrowserHelper = createBrowserHelper(myBrowser),
        myPage = await myBrowserHelper.getDefaultPage(),
        myPageHelper = createPageHelper(myPage);
})();