npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nemo-firefox-profile

v2.0.0

Published

Adds custom firefox preferences to nemo firefox driver instance

Downloads

6

Readme

nemo-firefox-profile

Firefox profile for Nemo automation framework. nemo-firefox-profile is a nemo-plugin written using firefox-profile-js.

Nemo Installation

Install nemo and nemo-firefox-profile

 npm install nemo --save-dev
 npm install nemo-firefox-profile --save-dev

nemo-firefox-profile Registration

Add nemo-firefox-profile to your nemo config under plugins section in config/config.json file like below. Make sure priority<100 to allow plugin to register before nemo initializes selenium-webdriver

"plugins" : {
        "firefox_profile": {
                   "module": "nemo-firefox-profile",
                   "priority": 99,
                   "arguments": [
                          {
                             "firefoxPreferences": {
                               "browser.download.folderList": 2,
                               "browser.download.dir": "/Users/nemoUser",
                               "browser.helperApps.neverAsk.saveToDisk": "text/csv"
                             }
                          }
                   ]
        }
  }

Plugin Arguments

You can pass firefox preferences to nemo via plugin arguments like below,

"plugins": {
    "firefox-profile": {
      "module": "nemo-firefox-profile",
      "arguments": [
        {
           "firefoxPreferences": {
                "browser.download.folderList": 2,
                "browser.download.dir": "/Users/nemoUser",
                "browser.helperApps.neverAsk.saveToDisk": "text/csv"
           },
           "firefoxProfileDirectory": "/path/to/profile's folder",
           "firefoxExtensions": [
                "example/resources/modify_headers-0.7.1.1-fx.xpi",
                "example/resources/firebug-2.0.0.xpi"
           ]
        }
      ],
      "priority": 99
    }
 }

You must pass either firefoxPreferences with custom preferences or firefoxProfileDirectory to load existing Firefox profile OR both. You can also include add-ons to firefox instance by providing them under firefoxExtensions as an array argument

Once the plugin is configured correctly, nemo-firefox-profile would update "serverCaps" as below

  "serverCaps": {
    "firefox_profile": {zipped, base64 encoded string of the profile directory for use with remote WebDriver JSON wire protocol}
  }

Example

A sample nemo test example/nemoFirefoxProfileExample.js is written to demonstrate how to use nemo-firefox-profile. Custom firefox preferences are provided under example/config/config.json. We also add a custom header using modify-headers extension

Once you clone the plugin, at the root level execute following,

npm install
DEBUG=nemo* node example/nemoFirefoxProfileExample.js

You will see a bunch of nemo logs and a firefox launched with a blank window. In the address bar you can type about:config and check whether your custom firefox preferences were applied or not. Accept firefox risk page and in the address bar type browser.download.dir. You will see the value to be /Users/nemoUser and status to be user set. You can also see that modify-headers is added to the browser with header Custom-Header being set to value Cookie. modify-headers extension could be found at the top right corner of the browser as red icon. That's it, you were able to configure nemo-firefox-profile correctly and able to successfully set custom firefox preferences. Browser will close automatically after 60s (timeout set so that users could test firefox preferences).

Acknowledgement

Thank you @saadtazi for your work on firefox-profile-js