How to use foxdriver - 3 common examples

To help you get started, we’ve selected a few foxdriver examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github autonome / puppeteer-fx / index.js View on Github external
var launchCfg = {
      url: defaultLaunchURL,
      bin: opts.executablePath || '',
      args: []
    };

    if (opts.headless) {
      launchCfg.args.push('--headless');
    }

    if (opts.userDataDir) {
      launchCfg.args.push('--profile');
      launchCfg.args.push(opts.userDataDir);
    }

    const { browser: fdBrowser, tab: fdTab } = await foxdriver.launch(launchCfg);

    if (opts.throttling) {
      const downloadThroughput = opts.throttling.downloadThroughput || 75000
      const uploadThroughput = opts.throttling.uploadThroughput || 25000
      const latency = opts.throttling.latency || 100
      await fdTab.emulation.setNetworkThrottling(downloadThroughput, uploadThroughput, latency);
    }

    return new browser({fdBrowser, fdTab});
	}
}
github autonome / puppeteer-fx / source / Browser.js View on Github external
constructor(launcher, throttler) {

        super()[_throttler_] = throttler;

        this.open = true;

        this[_remote_] = FoxDriver.launch( launcher ).then(
            ({ browser })  =>  browser
        );
    }
github cypress-io / cypress / packages / server / lib / browsers / firefox-util.ts View on Github external
async setupFoxdriver () {
    await _connectAsync({
      host: '127.0.0.1',
      port: 2929,
    })

    const foxdriver = await Foxdriver.attach('127.0.0.1', 2929)

    const { browser } = foxdriver

    const attach = Promise.method((tab) => {
      return tab.memory.attach()
    })

    cb = () => {
      return browser.listTabs()
      .then((tabs) => {
        browser.tabs = tabs

        return Promise.mapSeries(tabs, (tab: any) => {
          return attach(tab)
          .then(() => {
            return tab.memory.forceCycleCollection()

foxdriver

Foxdriver is a Node library which provides a high-level API to control Firefox over the Remote Debugging Protocol

Apache-2.0
Latest version published 3 years ago

Package Health Score

45 / 100
Full package analysis

Popular foxdriver functions