From 3e99112a0d59878c6f31cc50fe8b0593c49e497f Mon Sep 17 00:00:00 2001 From: kvetko <37440134+kvetko@users.noreply.github.com> Date: Thu, 28 Jun 2018 22:24:39 +0200 Subject: [PATCH] Allow temporary installation of FF extension (#1) (#5751) * Allow temporary installation of FF extension Extremely handy for testing browser extensions without the need of signing them --- javascript/node/selenium-webdriver/firefox.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/javascript/node/selenium-webdriver/firefox.js b/javascript/node/selenium-webdriver/firefox.js index d2ae6f5298b0d..e87f373378164 100644 --- a/javascript/node/selenium-webdriver/firefox.js +++ b/javascript/node/selenium-webdriver/firefox.js @@ -624,15 +624,18 @@ class Driver extends webdriver.WebDriver { * * @param {string} path Path on the local filesystem to the web extension to * install. + * @param {boolean} temporary Flag indicating whether the extension should be + * installed temporarily - gets removed on restart * @return {!Promise} A promise that will resolve to an ID for the * newly installed addon. * @see #uninstallAddon */ - async installAddon(path) { + async installAddon(path, temporary=false) { let buf = await io.read(path); return this.execute( new command.Command(ExtensionCommand.INSTALL_ADDON) - .setParameter('addon', buf.toString('base64'))); + .setParameter('addon', buf.toString('base64')) + .setParameter('temporary', temporary)); } /**