MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / installAddon

Method installAddon

javascript/selenium-webdriver/firefox.js:655–670  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

653 * @see #uninstallAddon
654 */
655 async installAddon(path, temporary = false) {
656 let stats = fs.statSync(path)
657 let buf
658 if (stats.isDirectory()) {
659 let zip = new Zip()
660 await zip.addDir(path)
661 buf = await zip.toBuffer('DEFLATE')
662 } else {
663 buf = await io.read(path)
664 }
665 return this.execute(
666 new command.Command(ExtensionCommand.INSTALL_ADDON)
667 .setParameter('addon', buf.toString('base64'))
668 .setParameter('temporary', temporary),
669 )
670 }
671
672 /**
673 * Uninstalls an addon from the current browser session's profile.

Callers 1

addon_test.jsFile · 0.80

Calls 7

addDirMethod · 0.95
toBufferMethod · 0.95
setParameterMethod · 0.80
isDirectoryMethod · 0.65
readMethod · 0.65
executeMethod · 0.65
toStringMethod · 0.65

Tested by

no test coverage detected