* Installs a new addon with the current session. This function will return an * ID that may later be used to plain #uninstallAddon uninstall the * addon. * * * @param {string} path Path on the local filesystem to the web extension to * install. * @param {boolean} temp
(path, temporary = false)
| 559 | * @deprecated Use {@link #installWebExtension} instead. |
| 560 | */ |
| 561 | async installAddon(path, temporary = false) { |
| 562 | webdriver.WebDriver.logger.deprecate( |
| 563 | 'firefox-installAddon', |
| 564 | 'firefox.Driver#installAddon() is deprecated. Use driver.installWebExtension() instead.', |
| 565 | ) |
| 566 | let stats = fs.statSync(path) |
| 567 | let buf |
| 568 | if (stats.isDirectory()) { |
| 569 | let zip = new Zip() |
| 570 | await zip.addDir(path) |
| 571 | buf = await zip.toBuffer('DEFLATE') |
| 572 | } else { |
| 573 | buf = await io.read(path) |
| 574 | } |
| 575 | return this.execute( |
| 576 | new command.Command(ExtensionCommand.INSTALL_ADDON) |
| 577 | .setParameter('addon', buf.toString('base64')) |
| 578 | .setParameter('temporary', temporary), |
| 579 | ) |
| 580 | } |
| 581 | |
| 582 | /** |
| 583 | * Uninstalls an addon from the current browser session's profile. |
no test coverage detected