UNPKG

selenium-webdriver

Version:

The official WebDriver JavaScript bindings from the Selenium project

18 lines 14.7 kB
<!DOCTYPE html><meta charset="UTF-8"><meta http-equiv="Content-Language" content="en" /><title>Profile</title><link href="dossier.css" rel="stylesheet" type="text/css"><div id="main-wrapper"><input type="checkbox" id="sidenav-toggle" /><main><header><h1>Class Profile</h1><a class="source" href="source/firefox/profile.js.src.html#l406">code &raquo;</a></header><section><p>Models a Firefox proifle directory for use with the FirefoxDriver. The <code >Proifle</code> directory uses an in-memory model until <code class="type"><a class="unresolved-link">#writeToDisk</a></code> is called.<h2>Constructor</h2><div class="ctor wrap-details public"><div><div class="ctor"><span class="member">Profile <span class="args">( opt_dir )</span></span></div><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>opt_dir: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>=</code><dd>Path to an existing Firefox profile directory to use a template for this profile. If not specified, a blank profile will be used.</dl></table></div></div></div></section><div id="visibility-controls"><b>Show:</b><label for="show-public"><span><input type="checkbox" id="show-public" checked/></span>Public</label><label for="show-protected"><span><input type="checkbox" id="show-protected"/></span>Protected</label><label for="show-private"><span><input type="checkbox" id="show-private"/></span>Private</label></div><section id="instance-methods"><h2>Instance Methods</h2><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/firefox/profile.js.src.html#l301">code &raquo;</a><span class="member"><a name="acceptUntrustedCerts">acceptUntrustedCerts</a> <span class="args">( )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>Whether the FirefoxDriver is configured to automatically accept untrusted SSL certificates.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/firefox/profile.js.src.html#l243">code &raquo;</a><span class="member"><a name="addExtension">addExtension</a> <span class="args">( extension )</span></span></div><p>Registers an extension to be included with this profile.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>extension: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>Path to the extension to include, as either an unpacked extension directory or the path to a xpi file.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/firefox/profile.js.src.html#l329">code &raquo;</a><span class="member"><a name="assumeUntrustedCertIssuer">assumeUntrustedCertIssuer</a> <span class="args">( )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>Whether to assume untrusted certs come from untrusted issuers.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/firefox/profile.js.src.html#l389">code &raquo;</a><span class="member"><a name="encode">encode</a> <span class="args">( )</span> &rArr; <code class="type">!promise.Promise.&lt;<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>&gt;</code></span></div><p>Encodes this profile as a zipped, base64 encoded directory.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>A promise for the encoded profile.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/firefox/profile.js.src.html#l283">code &raquo;</a><span class="member"><a name="getPort">getPort</a> <span class="args">( )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The port this profile is currently configured to use, or 0 if the port will be selected at random when the profile is written to disk.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/firefox/profile.js.src.html#l273">code &raquo;</a><span class="member"><a name="getPreference">getPreference</a> <span class="args">( key )</span> &rArr; <code class="type">(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined">undefined</a>)</code></span></div><p>Returns the currently configured value of a profile preference. This does not include any defaults defined in the profile's template directory user.js file (if a template were specified on construction).</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>key: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The desired preference.</dl><tr><th>Returns<tr><td><dl>The current value of the requested preference.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/firefox/profile.js.src.html#l347">code &raquo;</a><span class="member"><a name="nativeEventsEnabled">nativeEventsEnabled</a> <span class="args">( )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Returns whether native events are enabled in this profile.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/firefox/profile.js.src.html#l311">code &raquo;</a><span class="member"><a name="setAcceptUntrustedCerts">setAcceptUntrustedCerts</a> <span class="args">( value )</span></span></div><p>Sets whether the FirefoxDriver should automatically accept untrusted SSL certificates.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>value: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd>.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/firefox/profile.js.src.html#l320">code &raquo;</a><span class="member"><a name="setAssumeUntrustedCertIssuer">setAssumeUntrustedCertIssuer</a> <span class="args">( value )</span></span></div><p>Sets whether to assume untrusted certificates come from untrusted issuers.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>value: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd>.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/firefox/profile.js.src.html#l338">code &raquo;</a><span class="member"><a name="setNativeEventsEnabled">setNativeEventsEnabled</a> <span class="args">( enabled )</span></span></div><p>Sets whether to use native events with this profile.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>enabled: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd>.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/firefox/profile.js.src.html#l292">code &raquo;</a><span class="member"><a name="setPort">setPort</a> <span class="args">( port )</span></span></div><p>Sets the port to use for the WebDriver extension loaded by this profile.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>port: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>The desired port, or 0 to use any free port.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/firefox/profile.js.src.html#l254">code &raquo;</a><span class="member"><a name="setPreference">setPreference</a> <span class="args">( key, value )</span></span></div><p>Sets a desired preference for this profile.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>key: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The preference key.<dt>value: <code class="type">(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>)</code><dd>The preference value.</dl><tr><th>Throws<tr><td><dl><dt><code class="type"><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Error">Error</a></code><dd>If attempting to set a frozen preference.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/firefox/profile.js.src.html#l361">code &raquo;</a><span class="member"><a name="writeToDisk">writeToDisk</a> <span class="args">( opt_excludeWebDriverExt )</span> &rArr; <code class="type">!promise.Promise.&lt;<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>&gt;</code></span></div><p>Writes this profile to disk.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>opt_excludeWebDriverExt: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd>Whether to exclude the WebDriver extension from the generated profile. Used to reduce the size of an <code class="type"><a class="unresolved-link">encoded profile</a></code> since the server will always install the extension itself.</dl><tr><th>Returns<tr><td><dl>A promise for the path to the new profile directory.</dl></table></div></details></div></div></section><section id="instance-properties"><h2>Instance Properties</h2><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/firefox/profile.js.src.html#l234">code &raquo;</a><span class="member"><a name="extensions_">extensions_</a> : <code class="type">!<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.&lt;<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>&gt;</code></span></div></summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/firefox/profile.js.src.html#l225">code &raquo;</a><span class="member"><a name="nativeEventsEnabled_">nativeEventsEnabled_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div></summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/firefox/profile.js.src.html#l231">code &raquo;</a><span class="member"><a name="port_">port_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div></summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/firefox/profile.js.src.html#l219">code &raquo;</a><span class="member"><a name="preferences_">preferences_</a> : <code class="type">!<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></code></span></div></summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/firefox/profile.js.src.html#l228">code &raquo;</a><span class="member"><a name="template_">template_</a> : <code class="type">(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined">undefined</a>)</code></span></div></summary></details></div></div></section></main><nav id="topnav"><div><div id="menubutton"><label for="sidenav-toggle">Menu</label></div><form id="searchbox"><div><input type="search" placeholder="Search" tabindex="1"></div></form></div></nav><nav id="sidenav"><input type="checkbox" id="sidenav-types-ctrl" /><input type="checkbox" id="sidenav-files-ctrl" /><input type="checkbox" id="sidenav-modules-ctrl" /><a id="sidenav-overview"><div><h4>Overview</h4></div></a><div id="sidenav-types"><label for="sidenav-types-ctrl"><h4>Types</h4></label><i>Loading</i></div><div id="sidenav-modules"><label for="sidenav-modules-ctrl"><h4>Modules</h4></label><i>Loading</i></div><div id="sidenav-files"><label for="sidenav-files-ctrl"><h4>Files</h4></label><i>Loading</i></div><a href="license.html"><div><h4>License</h4></div></a></nav><div id="push-footer"></div></div><footer><a href="https://github.com/jleyba/js-dossier">Generated by dossier</a></footer><script src="types.js"></script><script src="dossier.js"></script>