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 e080f5bb7d 🐛 Fix d5b9697 5 days ago
lib ♻️ Refactor 95e0fc2 'set' method 4 weeks ago
src 🐛 Fix d5b9697 5 days ago
.gitignore 🎉 Initial commit 6 months ago
DOCUMENTATION.md 📝 As per f01772e, f92a45f, 2c44490 3 weeks ago
README.md 🚚 Rename helper creation methods 3 weeks ago
mod.js 🚚 Rename helper creation methods 3 weeks ago
package.json 🔨 Add 'docgen' script 3 weeks ago
yarn.lock 🎉 Initial commit 6 months ago

README.md

puppeteer-helpers

Documentation

Basic usage (using puppeteer)

const
    puppeteer = require('puppeteer'),
    {
        browser: browserHelper,
        page: pageHelper
    } = require('puppeteer-helpers');

(async () => {
    const
        myBrowser = await puppeteer.launch(),
        myBrowserHelper = browserHelper(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);
})();