1.0.2 • Published 10 months ago

puppeteer-auto-position v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
10 months ago

Puppeteer Auto Position

demo

A simple Puppeteer module that automatically sets window positions when launching new browsers.

Installation

npm install puppeteer-auto-position

Usage

const { puppeteerWindow } = require('puppeteer-auto-position');

(async () => {
    const browsers = [];
    for(let i=0; i<6; i++){
        const browser = await puppeteerWindow(i);
        browsers.push(browser);
    }

    for(const browser of browsers){
        const page = await browser.newPage();
        await page.goto("https://google.com");
        // Do something with the page...
    }

})();

Options

The puppeteerWindow function takes an optional second argument, an options object where you can specify the width, height, and screenWidth:

const browser = await puppeteerWindow(i, {
    width: 800, // default is 640
    height: 600, // default is 480
    screenWidth: 1920 // default is 1920
});
1.0.2

10 months ago

1.0.1

11 months ago

1.0.0

11 months ago