* 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
(extension, options = undefined)
| 614 | * @override |
| 615 | */ |
| 616 | async installWebExtension(extension, options = undefined) { |
| 617 | options = webExtension.checkInstallOptions(options, ['permanent', 'allowPrivateBrowsing'], 'Firefox') |
| 618 | const { permanent, allowPrivateBrowsing } = options |
| 619 | |
| 620 | if (!(await webExtension.isBidiEnabled(this))) { |
| 621 | const cmd = new command.Command(ExtensionCommand.INSTALL_ADDON).setParameter( |
| 622 | 'addon', |
| 623 | await webExtension.encodeExtension(extension), |
| 624 | ) |
| 625 | if (permanent !== undefined) cmd.setParameter('temporary', !permanent) |
| 626 | if (allowPrivateBrowsing !== undefined) cmd.setParameter('allowPrivateBrowsing', allowPrivateBrowsing) |
| 627 | return new webExtension.WebExtension(await this.execute(cmd)) |
| 628 | } |
| 629 | |
| 630 | const { MozWebExtension } = require('./bidi/generated/webextension') |
| 631 | const module = await MozWebExtension.create(this) |
| 632 | const result = await module.install({ |
| 633 | extensionData: await webExtension.extensionData(this, extension), |
| 634 | ...options, |
| 635 | }) |
| 636 | return new webExtension.WebExtension(result.extension) |
| 637 | } |
| 638 | |
| 639 | /** |
| 640 | * Uninstalls a browser extension installed with {@link #installWebExtension}. Uses BiDi when |
nothing calls this directly
no test coverage detected