t2-puppeteer-plugin-block-resources
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

t2-puppeteer-plugin-block-resources

npm version

Description

Installation

    npm install t2-puppeteer-plugin-block-resources

or using Yarn:

    yarn add t2-puppeteer-plugin-block-resources

Usage with puppeteer-extra

import puppeteerExtra from 'puppeteer-extra';
import blockResources from 't2-puppeteer-plugin-block-resources';

// | "document"
// | "stylesheet"
// | "image"
// | "media"
// | "font"
// | "script"
// | "texttrack"
// | "xhr"
// | "fetch"
// | "eventsource"
// | "websocket"
// | "manifest"
// | "other"

const bl=blockResources()
bl.add(['image','media','stylesheet'])
puppeteerExtra.use(bl);

(async () => {
  const browser = await puppeteerExtra.launch({
    headless:false,
    userDataDir:'./profile'
  });
  const page = await browser.newPage();

  await page.setViewport({
    width: 1920,
    height: 1080
});

  await page.goto('https://unsplash.com/')

//   await browser.close();
})();

Package Sidebar

Install

npm i t2-puppeteer-plugin-block-resources

Weekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

5.77 kB

Total Files

4

Last publish

Collaborators

  • 2noscript.dev