firefox-profile
Version:
firefox profile for selenium WebDriverJs, admc/wd or any other node selenium driver that supports capabilities
202 lines (115 loc) • 8.48 kB
Markdown
Constructor
_Source: [lib/firefox_profile.js](../lib/firefox_profile.js)_
<a name="tableofcontents"></a>
- <a name="toc_firefoxprofileprofiledirectory"></a>[FirefoxProfile](
- <a name="toc_firefoxprofileprototypedeletedir"></a><a name="toc_firefoxprofileprototype"></a>[FirefoxProfile.prototype.deleteDir](
- <a name="toc_firefoxprofileprototypeshoulddeleteonexittrue"></a>[FirefoxProfile.prototype.shouldDeleteOnExit](
- <a name="toc_firefoxprofileprototypewilldeleteonexit"></a>[FirefoxProfile.prototype.willDeleteOnExit](
- <a name="toc_firefoxprofileprototypesetpreferencekey-value"></a>[FirefoxProfile.prototype.setPreference](
- <a name="toc_firefoxprofileprototypeaddextensionpath-callback"></a>[FirefoxProfile.prototype.addExtension](
- <a name="toc_firefoxprofileprototypeaddextensionspath-callback"></a>[FirefoxProfile.prototype.addExtensions](
- <a name="toc_firefoxprofileprototypeupdatepreferences"></a>[FirefoxProfile.prototype.updatePreferences](
- <a name="toc_firefoxprofileprototypepath"></a>[FirefoxProfile.prototype.path](
- <a name="toc_firefoxprofileprototypecanacceptuntrustedcerts"></a>[FirefoxProfile.prototype.canAcceptUntrustedCerts](
- <a name="toc_firefoxprofileprototypesetacceptuntrustedcertstrue"></a>[FirefoxProfile.prototype.setAcceptUntrustedCerts](
- <a name="toc_firefoxprofileprototypecanassumeuntrustedcertissuer"></a>[FirefoxProfile.prototype.canAssumeUntrustedCertIssuer](
- <a name="toc_firefoxprofileprototypesetassumeuntrustedcertissuertrue"></a>[FirefoxProfile.prototype.setAssumeUntrustedCertIssuer](
- <a name="toc_firefoxprofileprototypenativeeventsenabled"></a>[FirefoxProfile.prototype.nativeEventsEnabled](
- <a name="toc_firefoxprofileprototypesetnativeeventsenabledboolean"></a>[FirefoxProfile.prototype.setNativeEventsEnabled](
- <a name="toc_firefoxprofileprototypeencodedfunction"></a>[FirefoxProfile.prototype.encoded](
- <a name="toc_firefoxprofileprototypesetproxyobject"></a>[FirefoxProfile.prototype.setProxy](
> Initialize a new instance of a Firefox Profile
**Parameters:**
- `{String | null} profileDirectory` optional. if provided, it will copy the directory
<sub>Go: [TOC](
<a name="firefoxprofileprototype"></a>
> Deletes the profile directory.
Call it only if you do not need the profile. Otherwise use at your own risk.
this function is automatically called by default (= if willDeleteOnExit() returns true)
<sub>Go: [TOC](#tableofcontents) | [FirefoxProfile.prototype](#toc_firefoxprofileprototype)</sub>
# FirefoxProfile.prototype.shouldDeleteOnExit(true)
> Specify if the profile Directory should be deleted on process.exit()
Note: by default:
* if the constructor is called without param: the new profile directory is deleted
* if the constructor is called with param (path to profile dir): the dir is copied at init and the copy is deleted on exit
**Parameters:**
- `{boolean} true`
<sub>Go: [TOC](
> returns true if the profile directory will be deleted on process.exit()
**Return:**
`{boolean}` true if (default)
<sub>Go: [TOC](#tableofcontents) | [FirefoxProfile.prototype](#toc_firefoxprofileprototype)</sub>
# FirefoxProfile.prototype.setPreference(key, value)
> Set a user preference.
Any modification to the user preference can be persisted using this.updatePreferences()
If this.setPreference() is called before calling this.encoded(), then this.updatePreferences()
is automatically called.
For a comprehensive list of preference keys, see http://kb.mozillazine.org/About:config_entries
**Parameters:**
- `{string} key` - the user preference key
- `{boolean | string} value`
**See:**
- [about:config](http://kb.mozillazine.org/About:config_entries)
<sub>Go: [TOC](
> Add an extension to the profile.
**Parameters:**
- `{string} path` - path to a xpi extension file or a unziped extension folder
- `{function} callback` - the callback function to call when the extension is added
<sub>Go: [TOC](
> Add mutliple extension to the profile.
**Parameters:**
- `{string} path` - path to a xpi extension file or a unziped extension folder
- `{function} callback` - the callback function to call when the extension is added
<sub>Go: [TOC](
> Save user preferences to the user.js profile file.
updatePreferences() is automatically called when encoded() is called
(if needed = if setPreference() was called before calling encoded())
<sub>Go: [TOC](#tableofcontents) | [FirefoxProfile.prototype](#toc_firefoxprofileprototype)</sub>
# FirefoxProfile.prototype.path()
> @return {string} path of the profile extension directory
<sub>Go: [TOC](
> @return {boolean} true if webdriver can accept untrusted certificates
<sub>Go: [TOC](
> If not explicitly set, default: true
**Parameters:**
- `{boolean} true` to accept untrusted certificates, false otherwise.
<sub>Go: [TOC](
> @return {boolean} true if webdriver can assume untrusted certificate issuer
<sub>Go: [TOC](
> If not explicitly set, default: true
**Parameters:**
- `{boolean} true` to make webdriver assume untrusted issuer.
<sub>Go: [TOC](
> @return {boolean} true if native events are enabled
<sub>Go: [TOC](
> If not explicitly set, default: true
**Parameters:**
- `{boolean} boolean` true to enable native events.
<sub>Go: [TOC](
> return zipped, base64 encoded string of the profile directory
for use with remote WebDriver JSON wire protocol
**Parameters:**
- `{Function} function` a callback function with first params as a zipped, base64 encoded string of the profile directory
<sub>Go: [TOC](
> set network proxy settings.
if proxy type is 'manual', then possible settings are: 'ftp', 'http', 'ssl', 'socks'
if proxy type is 'pac', the setting should be 'autoconfig_url'
for other values, only the proxy.type pref will be set
**Parameters:**
- `{Object} object` a proxy object. Mandatary attribute: proxyType
<sub>Go: [TOC](
_—generated by [apidox](https://github.com/codeactual/apidox)—_