Methods
getContext() → (non-null) {Promise.<Context>}
Get the context that is currently in effect.
- Source
Current context.
- Type:
- Promise.<Context>
(async) installAddon(path, temporary) → (non-null) {Promise.<string>}
Installs a new addon with the current session. This function will return an ID that may later be used to uninstall the addon.
| Name | Type | Default | Description |
|---|---|---|---|
path | string | Path on the local filesystem to the web extension to install. | |
temporary | boolean | false | Flag indicating whether the extension should be installed temporarily - gets removed on restart |
- Deprecated
- Use #installWebExtension instead.
- Source
A promise that will resolve to an ID for the newly installed addon.
- Type:
- Promise.<string>
(async) installWebExtension(extension, optionsopt) → (non-null) {Promise.<!webExtension.WebExtension>}
Installs a browser extension. Works with remote (Grid) sessions. Uses BiDi when the session has it enabled, and otherwise falls back to geckodriver's classic addon endpoint.
Pass permanent: false to install an unsigned extension; without the option, each transport applies its own default. A directory cannot be installed permanently over BiDi.
| Name | Type | Attributes | Description |
|---|---|---|---|
extension | string | an unpacked extension directory, a packed extension file (.xpi/.zip), or base64-encoded bytes of one. | |
options | Object | <optional> |
|
- Source
the installed extension.
- Type:
- Promise.<!webExtension.WebExtension>
setContext(ctxnon-null)
Changes target context for commands between chrome- and content.
Changing the current context has a stateful impact on all subsequent commands. The Context.CONTENT context has normal web platform document permissions, as if you would evaluate arbitrary JavaScript. The Context.CHROME context gets elevated permissions that lets you manipulate the browser chrome itself, with full access to the XUL toolkit.
Use your powers wisely.
| Name | Type | Description |
|---|---|---|
ctx | Promise.<void> | The context to switch to. |
- Source
setFileDetector()
This function is a no-op as file detectors are not supported by this implementation.
- Source
takeFullPageScreenshot() → (non-null) {Promise.<string>}
Take full page screenshot of the visible region
- Source
A promise that will be resolved to the screenshot as a base-64 encoded PNG.
- Type:
- Promise.<string>
(async) uninstallAddon(id) → (non-null) {Promise}
Uninstalls an addon from the current browser session's profile.
| Name | Type | Description |
|---|---|---|
id | string | | ID of the addon to uninstall. |
- Deprecated
- Use #uninstallWebExtension instead.
- Source
A promise that will resolve when the operation has completed.
- Type:
- Promise
(async) uninstallWebExtension(extensionnon-null) → (non-null) {Promise.<void>}
Uninstalls a browser extension installed with #installWebExtension. Uses BiDi when the session has it enabled, and otherwise geckodriver's classic addon endpoint.
| Name | Type | Description |
|---|---|---|
extension | webExtension. | the extension returned by #installWebExtension. |
- Source
- Type:
- Promise.<void>
(static) createSession(opt_configopt, opt_executoropt) → (non-null) {Driver}
Creates a new Firefox session.
| Name | Type | Attributes | Description |
|---|---|---|---|
opt_config | Options | | <optional> | The configuration options for this driver, specified as either an Options or Capabilities, or as a raw hash object. |
opt_executor | http. | <optional> | Either a pre-configured command executor to use for communicating with an externally managed remote end (which is assumed to already be running), or the If an executor is provided, care should e taken not to use reuse it with other clients as its internal command mappings will be updated to support Firefox-specific commands. This parameter may only be used with Mozilla's GeckoDriver. |
- Source
If a custom command executor is provided and the driver is configured to use the legacy FirefoxDriver from the Selenium project.
- Type
- Error
A new driver instance.
- Type:
- Driver