Coder Social home page Coder Social logo

puppeteer-fx's Introduction

Puppeteer for Firefox

Headless Firefox NodeJS API based on FoxDriver (written by the wonderful folks at Sauce Labs), which is compatible with Puppeteer API.

NPM Dependency Build Status

NPM

Supported APIs

Execute npm start for details.

Extra APIs

Network Throttling

  • Firefox-only
  • Add "throttling" option to launch()
  • Supported properties
    • downloadThroughput: integer, bytes/s, defaults to 75000
    • uploadThroughput: integer, bytes/s, defaults to 25000
    • latency: integer, in milliseconds, defaults to 100

Installation

It's on NPM, so add puppeteer-fx to your dependencies in package.json, or:

npm install puppeteer-fx

Example

const puppeteer = require('./puppeteer-fx');

(async () => {

    const browser = await puppeteer.launch({headless: false});

    const page = await browser.newPage();

    await page.goto('https://mozilla.github.io/arewefastyet-speedometer/2.0/');

    await page.evaluate(
        'document.querySelector("section#home div.buttons button").click()'
    );
})();

Profiles

Similar works

puppeteer-fx's People

Contributors

autonome avatar techquery avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

puppeteer-fx's Issues

page.setRequestInterception is not a function

Hello,

Thanks for making this package, I'm trying to use it to test my code on Firefox, however I need setRequestInterception and it doesn't seem to be available, though it is part of puppeteer.

Any chance it could be done using headless Firefox? I'll try to dig and find the answer myself, if I'll find something I'll make a PR, but thought maybe you already tried.

puppeteer-fx TypeError : Click is not a fiunction

  • Puppeteer version:1.12.2
  • Node.js version:v11.6.0

I am trying to get puppeteer-fx to work, code below is launching the firefox browser, but i get the TypeError: scope.context.currentPage.click is not a function. Works in Chrome, no issues.
Looks like its not including puppeteer with puppeteer-fx during the runtime? Any suggestions please?

const b = process.env.PUPPETEER_BROWSER || 'chrome';
const puppeteer = b === 'firefox' ?
require('puppeteer-fx') : require('puppeteer')

const World = function() {
scope.driver = puppeteer;
scope.context = {};
};

await scope.context.currentPage.goto(CREDS.url);
await scope.context.currentPage.click(loginpage.loginfields.USERNAME_SELECTOR);

Error on running test

I'm running sample as shown on here. I get this error:
Error: Cannot find module 'babel-runtime/helpers/asyncToGenerator'

Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.