NeXTSTEP Programming Mastermind

    puppeteer-in-electron

    3.0.5 • Public • Published

    Introducing puppeteer-in-electron

    Use puppeteer to test and control your electron application.

    npm install puppeteer-in-electron puppeteer-core electron
    

    See the API documentation.

    JavaScript

    const {BrowserWindow, app} = require("electron");
    const pie = require("puppeteer-in-electron")
    const puppeteer = require("puppeteer-core");
    
    const main = async () => {
      await pie.initialize(app);
      const browser = await pie.connect(app, puppeteer);
     
      const window = new BrowserWindow();
      const url = "https://example.com/";
      await window.loadURL(url);
     
      const page = await pie.getPage(browser, window);
      console.log(page.url());
      window.destroy();
    };
    
    main();

    TypeScript

    import {BrowserWindow, app} from "electron";
    import pie from "puppeteer-in-electron";
    import puppeteer from "puppeteer-core";
    
    const main = async () => {
      await pie.initialize(app);
      const browser = await pie.connect(app, puppeteer);
    
      const window = new BrowserWindow();
      const url = "https://example.com/";
      await window.loadURL(url);
    
      const page = await pie.getPage(browser, window);
      console.log(page.url());
      window.destroy();
    };
    
    main();

    Install

    npm i puppeteer-in-electron

    DownloadsWeekly Downloads

    279

    Version

    3.0.5

    License

    MIT

    Unpacked Size

    28.5 kB

    Total Files

    18

    Last publish

    Collaborators

    • trevorsundberg