UNPKG

selenium-webdriver

Version:

The official WebDriver JavaScript bindings from the Selenium project

50 lines 11.3 kB
<!DOCTYPE html><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"><meta http-equiv="Content-Language" content="en"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>Profile</title><link href="dossier.css" rel="stylesheet" type="text/css"><header><div><form><div><input type="search" placeholder="Search" tabindex="1"></div></form></div></header><main><article><div class="parentlink"><b>Module:</b> <a href="module_selenium-webdriver_firefox_profile.html">selenium-webdriver/firefox/profile</a></div><div class="codelink"><a href="source/firefox/profile.js.src.html#l429">View Source</a></div><h1>class Profile</h1><pre class="inheritance"><a href="class_webdriver_Serializable.html">webdriver.Serializable</a> &#x2514; Profile</pre><p>Models a Firefox proifle directory for use with the FirefoxDriver. The <code>Proifle</code> directory uses an in-memory model until <a href="module_selenium-webdriver_firefox_profile_class_Profile.html#writeToDisk"><code>#writeToDisk</code></a> is called.</p> <h3>new Profile(<wbr>opt_dir)</h3><div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>opt_dir<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>=</code><dd><p>Path to an existing Firefox profile directory to use a template for this profile. If not specified, a blank profile will be used.</p> </dl></div></div><h2>Instance Methods</h2><div id="acceptUntrustedCerts" class="function"><div><h3>acceptUntrustedCerts()<span class="codelink"><a href="source/firefox/profile.js.src.html#l314">code »</a></span></h3><div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd><p>Whether the FirefoxDriver is configured to automatically accept untrusted SSL certificates.</p> </dl></div></div></div></div><hr class="fn-sep"><div id="addExtension" class="function"><div><h3>addExtension(<wbr>extension)<span class="codelink"><a href="source/firefox/profile.js.src.html#l256">code »</a></span></h3><p>Registers an extension to be included with this profile.</p> <div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>extension<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd><p>Path to the extension to include, as either an unpacked extension directory or the path to a xpi file.</p> </dl></div></div></div></div><hr class="fn-sep"><div id="assumeUntrustedCertIssuer" class="function"><div><h3>assumeUntrustedCertIssuer()<span class="codelink"><a href="source/firefox/profile.js.src.html#l342">code »</a></span></h3><div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd><p>Whether to assume untrusted certs come from untrusted issuers.</p> </dl></div></div></div></div><hr class="fn-sep"><div id="encode" class="function"><div><h3>encode()<span class="codelink"><a href="source/firefox/profile.js.src.html#l402">code »</a></span></h3><p>Encodes this profile as a zipped, base64 encoded directory.</p> <div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a></code><dd><p>A promise for the encoded profile.</p> </dl></div></div></div></div><hr class="fn-sep"><div id="getPort" class="function"><div><h3>getPort()<span class="codelink"><a href="source/firefox/profile.js.src.html#l296">code »</a></span></h3><div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd><p>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.</p> </dl></div></div></div></div><hr class="fn-sep"><div id="getPreference" class="function"><div><h3>getPreference(<wbr>key)<span class="codelink"><a href="source/firefox/profile.js.src.html#l286">code »</a></span></h3><p>Returns the currently configured value of a profile preference. This does not include any defaults defined in the profile&#39;s template directory user.js file (if a template were specified on construction).</p> <div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>key<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd><p>The desired preference.</p> </dl></div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code>(<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><dd><p>The current value of the requested preference.</p> </dl></div></div></div></div><hr class="fn-sep"><div id="nativeEventsEnabled" class="function"><div><h3>nativeEventsEnabled()<span class="codelink"><a href="source/firefox/profile.js.src.html#l360">code »</a></span></h3><p>Returns whether native events are enabled in this profile.</p> <div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd><p>.</p> </dl></div></div></div></div><hr class="fn-sep"><div id="serialize" class="function"><div><h3>serialize()<span class="codelink"><a href="source/firefox/profile.js.src.html#l421">code »</a></span></h3><p>Encodes this profile as a zipped, base64 encoded directory.</p> <p><b>Overrides: </b><a href="class_webdriver_Serializable.html#serialize">webdriver.Serializable</a></p><div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a></code><dd><p>A promise for the encoded profile.</p> </dl></div></div></div></div><hr class="fn-sep"><div id="setAcceptUntrustedCerts" class="function"><div><h3>setAcceptUntrustedCerts(<wbr>value)<span class="codelink"><a href="source/firefox/profile.js.src.html#l324">code »</a></span></h3><p>Sets whether the FirefoxDriver should automatically accept untrusted SSL certificates.</p> <div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>value<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd><p>.</p> </dl></div></div></div></div><hr class="fn-sep"><div id="setAssumeUntrustedCertIssuer" class="function"><div><h3>setAssumeUntrustedCertIssuer(<wbr>value)<span class="codelink"><a href="source/firefox/profile.js.src.html#l333">code »</a></span></h3><p>Sets whether to assume untrusted certificates come from untrusted issuers.</p> <div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>value<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd><p>.</p> </dl></div></div></div></div><hr class="fn-sep"><div id="setNativeEventsEnabled" class="function"><div><h3>setNativeEventsEnabled(<wbr>enabled)<span class="codelink"><a href="source/firefox/profile.js.src.html#l351">code »</a></span></h3><p>Sets whether to use native events with this profile.</p> <div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>enabled<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd><p>.</p> </dl></div></div></div></div><hr class="fn-sep"><div id="setPort" class="function"><div><h3>setPort(<wbr>port)<span class="codelink"><a href="source/firefox/profile.js.src.html#l305">code »</a></span></h3><p>Sets the port to use for the WebDriver extension loaded by this profile.</p> <div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>port<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd><p>The desired port, or 0 to use any free port.</p> </dl></div></div></div></div><hr class="fn-sep"><div id="setPreference" class="function"><div><h3>setPreference(<wbr>key, value)<span class="codelink"><a href="source/firefox/profile.js.src.html#l267">code »</a></span></h3><p>Sets a desired preference for this profile.</p> <div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>key<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd><p>The preference key.</p> <dt>value<code>(<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><p>The preference value.</p> </dl></div><div class="fn-details"><div><b>Throws</b></div><dl><dt><code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a></code><dd><p>If attempting to set a frozen preference.</p> </dl></div></div></div></div><hr class="fn-sep"><div id="writeToDisk" class="function"><div><h3>writeToDisk(<wbr>opt_excludeWebDriverExt)<span class="codelink"><a href="source/firefox/profile.js.src.html#l374">code »</a></span></h3><p>Writes this profile to disk.</p> <div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>opt_excludeWebDriverExt<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd><p>Whether to exclude the WebDriver extension from the generated profile. Used to reduce the size of an <a href="module_selenium-webdriver_firefox_profile_class_Profile.html#encode"><code>encoded profile</code></a> since the server will always install the extension itself.</p> </dl></div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a></code><dd><p>A promise for the path to the new profile directory.</p> </dl></div></div></div></div></article><nav><h3><a href="index.html" tabindex="2">Overview</a></h3><div><input type="checkbox" id="nav-modules" checked/><label for="nav-modules"><h3><span class="selectable" tabindex="2">Modules</span></h3></label><div id="nav-modules-view"></div></div><div><input type="checkbox" id="nav-types" checked/><label for="nav-types"><h3><span class="selectable" tabindex="2">Types</span></h3></label><div id="nav-types-view"></div></div><h3><a href="Changes.html" tabindex="2">Changes</a></h3></nav></main><footer><div><a href="https://github.com/jleyba/js-dossier">Generated by dossier</a></div></footer><script src="types.js"></script><script src="dossier.js"></script>