{"name":"firefox-profile","version":"4.7.1","description":"firefox profile for selenium WebDriverJs, admc/wd or any other node selenium driver that supports capabilities","main":"lib/firefox_profile","types":"lib/firefox_profile.d.ts","directories":{"test":"test"},"scripts":{"test":"grunt travis"},"bin":{"firefox-profile":"lib/cli.js"},"repository":{"type":"git","url":"git://github.com/saadtazi/firefox-profile-js.git"},"keywords":["selenium","webdriver","firefox","firefox profile","nodejs"],"author":{"name":"Saad Tazi"},"license":"MIT","bugs":{"url":"https://github.com/saadtazi/firefox-profile-js/issues"},"contributors":[{"name":"testingbot","url":"http://www.testingbot.com"},{"name":"David Sturley","url":"https://github.com/circusbred"},{"name":"Jordan Santell","url":"http://jsantell.com"},{"name":"Piotr Kuczynski","url":"https://github.com/pkuczynski"},{"name":"halo2376","url":"https://github.com/halo2376"},{"name":"XrXr","url":"https://github.com/XrXr"},{"name":"Christoph Dorn","url":"http://www.christophdorn.com/"},{"name":"Holger Benl","url":"https://github.com/hbenl"},{"name":"Federico","url":"https://github.com/fregante"},{"name":"Luca Greco","url":"https://github.com/rpl"}],"devDependencies":{"blanket":"~1.2.x","chai":"~1.9.x","chai-as-promised":"~4.2.x","chai-fs":"~0.1.x","grunt":"^1.0.4","grunt-apidox":"~0.1.4","grunt-contrib-watch":"^1.1.0","grunt-mocha-cov":"^0.4.0","mocha":"^8.1.3","mocha-lcov-reporter":"1.3.0","request":"^2.88.0","sinon":"~1.12.x","sinon-chai":"~2.7.x","wd":"^1.11.4"},"dependencies":{"adm-zip":"~0.6.x","fs-extra":"^11.2.0","ini":"^4.1.3","minimist":"^1.2.8","xml2js":"^0.6.2"},"engines":{"node":">=18"},"gitHead":"f36e5431201836359eda74d6033285cbe9741ff3","_id":"firefox-profile@4.7.1","homepage":"https://github.com/saadtazi/firefox-profile-js#readme","_nodeVersion":"26.5.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-rUFGvJzXxhhOltBxf1aML9jTVismzgC3w00v2dG4Bxu5Xr6o9/D9QUT4do1ZUE9NHzmRFyQ6Bz+HBWnxZMO65w==","shasum":"9636dac892d9ed1cfee7a70b7d4b51c2347fc4e6","tarball":"http://registry-npm.ywwl.com/firefox-profile/download/firefox-profile-4.7.1.tgz","fileCount":11,"unpackedSize":48688,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDw4wjjcmCvbFQnnW47xTDIMEPOYwCen5lhD8AXLVzgnAiAtND8Zxmym4aoQVYA7FnjZaYQBAoTV39SRLd5d8V9gfw=="}],"size":15435,"noattachment":false,"key":"/firefox-profile/-/firefox-profile-4.7.1.tgz"},"_npmUser":{"name":"saadtazi","email":"stazi@fruitsoftware.com"},"maintainers":[{"name":"saadtazi","email":"stazi@fruitsoftware.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/firefox-profile_4.7.1_1785792677077_0.8412170224580455"},"_hasShrinkwrap":false,"readme":"# firefox-profile-js\n\n[![Build Status](https://travis-ci.org/saadtazi/firefox-profile-js.png)](https://travis-ci.org/saadtazi/firefox-profile-js)\n[![Coverage Status](https://coveralls.io/repos/saadtazi/firefox-profile-js/badge.png)](https://coveralls.io/r/saadtazi/firefox-profile-js)\n[![Dependency Status](https://david-dm.org/saadtazi/firefox-profile-js.png)](https://david-dm.org/saadtazi/firefox-profile-js)\n[![Selenium Test Status](https://saucelabs.com/buildstatus/saadtazi)](https://saucelabs.com/u/saadtazi)\n\n[![NPM](https://nodei.co/npm/firefox-profile.png)](https://nodei.co/npm/firefox-profile/)\n\nCreate or update Firefox Profile programmatically.\n\n## Notes for Selenium-webdriver package users\n\nIf you are using [`selenium-webdriver` package](http://seleniumhq.github.io/selenium/docs/api/javascript/), you no longer need to use this package: `selenium-webdriver` package now implements [a class that allows to create firefox profiles](http://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/firefox/profile.html). Check\n[this link](http://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/firefox.html)\nfor an example on how to set your own profile with `selenium-webdriver`. But you can still use this package with `selenium-webdriver`: here is [an example](https://github.com/juliemr/protractor-demo/issues/26). The important part in the example is to set the encoded profile on `.moz:firefoxOptions.profile` instead of on `.firefox_profile`.\n\nThis package is also useful if you use another webdriver library like [`wd.js`](http://admc.io/wd/) or any other webdriver json wire protocol implementation (`webdriver.io`?).\n\n# Introduction\n\nThis package allows you to:\n\n- create a firefox profile\n- use an existing profile (by specifying a path)\n- use an existing user profile (by specifying a name)\n- add extensions to your profile,\n- specify proxy settings,\n- set the user preferences...\n\nMore info on user preferences [here](http://kb.mozillazine.org/User.js_file).\n\nIt also contains a [command line interface](#command-line-interface) that allows to copy or create profiles.\n\n## Installation\n\n~~\"real\" npm support is on its way... soon... maybe... Open an issue if you need it...~~ Use npm:\n\n```\nnpm install firefox-profile\n```\n\nor `yarn`:\n\n```\nyarn add firefox-profile\n```\n\n## Usage\n\nMake sure you have selenium server running... or use 'selenium-webdriver/remote' class.\n\n### Steps\n\n- create a profile\n- modify the profile:\n  - setPreference(key, value)\n  - addExtension(path/To/Extenstion.xpi) or addExtension(path/To/Unpacked/Extension/)\n- create firefox capabilities and set the 'firefox_profile' capability\n- attach the capabilitites to your webdriver\n\n### I wanna see it!\n\n```js\n/******************************************************************\n     * with old version selenium webdriverJs\n     * WARNING: does not work with recent version of selenium-webdriver node bindings, which expect an instance of selenium-webdriver Firefox Profile page (`require('selenium-webdriver/firefox').Profile` or similar)\n     * @see: https://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/firefox/profile_exports_Profile.html\n     * installs firebug \n     * and make http://saadtazi.com the url that is opened on new tabs\n    /******************************************************************/\nvar webdriver = require(\"selenium-webdriver\");\n\n// create profile\nvar FirefoxProfile = require(\"firefox-profile\");\nvar myProfile = new FirefoxProfile();\n\n// you can add an extension by specifying the path to the xpi file\n// or to the unzipped extension directory\nmyProfile.addExtension(\"test/extensions/firebug-1.12.4-fx.xpi\", function () {\n  var capabilities = webdriver.Capabilities.firefox();\n\n  // you can set firefox preferences BEFORE calling encoded()\n  myProfile.setPreference(\"browser.newtab.url\", \"http://saadtazi.com\");\n\n  // attach your newly created profile\n\n  myProfile.encoded(function (err, encodedProfile) {\n    capabilities.set(\"firefox_profile\", encodedProfile);\n\n    // start the browser\n    var wd = new webdriver.Builder().withCapabilities(capabilities).build();\n\n    // woot!\n    wd.get(\"http://en.wikipedia.org\");\n  });\n});\n\n/**************************************************\n    /* with admc/wd\n    /* installs firebug, and make it active by default\n    /**************************************************/\n\nvar FirefoxProfile = require(\"firefox-profile\"),\n  wd = require(\"wd\");\n\n// set some userPrefs if needed\n// Note: make sure you call encoded() after setting some userPrefs\nvar fp = new FirefoxProfile();\n// activate and open firebug by default for all sites\nfp.setPreference(\"extensions.firebug.allPagesActivation\", \"on\");\n// activate the console panel\nfp.setPreference(\"extensions.firebug.console.enableSites\", true);\n// show the console panel\nfp.setPreference(\"extensions.firebug.defaultPanelName\", \"console\");\n// done with prefs?\nfp.updatePreferences();\n\n// you can install multiple extensions at the same time\nfp.addExtensions([\"./test/extensions/firebug-1.12.4-fx.xpi\"], function () {\n  fp.encoded(function (err, zippedProfile) {\n    if (err) {\n      console.error(\"oops, an error occured:\", err);\n      return;\n    }\n    browser = wd.promiseChainRemote();\n    // firefox 46-\n    //browser.init({\n    //  browserName:'firefox',\n    //  // set firefox_profile capabilities HERE!!!!\n    //  firefox_profile: zippedProfile\n    //}).\n    // firefox 47+\n    browser.init({\n      browserName: \"firefox\",\n      marionette: true,\n      \"moz:firefoxOptions\": {\n        profile: zippedProfile,\n      },\n    });\n    // woOot!!\n    get(\"http://en.wikipedia.org\");\n  });\n});\n```\n\nYou can also copy an existing profile... Check the doc `FirefoxProfile.copy(...)`.\n\n## Command Line Interface\n\nIt allows to copy (from profile name or profile directory) or create firefox profiles with installed extensions. Note that it does not allow to load user preferences... yet.\n\nRun `node_modules/bin/firefox-profile -h` to get the help message:\n\n```\nusage: firefox-profile [-v] [-p profilename || -c profile_dir] [-e extension_path1 [-e extension_path2]] [-o destination_dir || --ouput destination_dir || -b [file_path] || --base64 [file_path]]\n\n-v: verbose mode (same as --verbose)\n-h: show this message (same as --help)\n-p profilename: profile to copy (same as --profile)\n-c profile_dir: profile folder path to copy (same as --copy)\n-e extension_path: file path to extension to add to the profile. Can be present multiple times (same as --extension)\n-o destination_dir (or --output destination_dir): folder where the profile will be created.\n-b [file_path](or --base64): write the encoded firefox profile to stdout or to file_path if specified.\n```\n\n## API Documentation\n\nThe API documentation can be found in [doc/](./doc/).\n\nIt can be regenerated using `grunt docs`.\nRequires [apidox](https://github.com/codeactual/apidox) - listed in devDependencies.\n\n## Tests\n\n    mocha\n    # or\n    grunt mochacov:unit\n\n## Coverage\n\n    grunt mochacov:coverage\n\nGenerates doc/coverage.html\n\n## TODO\n\n- ~~add documentation and comments~~\n- ~~write tests~~\n- ~~fix bugs~~\n- ~~write more tests~~\n- fix more bugs\n- ~~clean tmp directory on process 'exit' and 'SIGINT'~~\n\n## Disclaimer\n\nThis class is actually a port of the [python class](https://code.google.com/p/selenium/source/browse/py/selenium/webdriver/firefox/firefox_profile.py).\n\n## Found a bug?\n\nOpen a [github issue](https://github.com/saadtazi/firefox-profile-js/issues).\n","publish_time":1785792677239,"_cnpm_publish_time":1785792677239,"dist-tags":{"latest":"4.7.1"}}