Last active
May 30, 2019 21:20
-
-
Save AllenFang/1cd424b783fbb99e9ea20867e472bfc1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import webdriver from 'selenium-webdriver'; | |
import firefox from 'selenium-webdriver/firefox'; | |
const XPI_PATH = ... // xpi file path | |
const firefoxOption = new firefox.Options(); | |
firefoxOption.setPreference('xpinstall.signatures.required', false); | |
firefoxOption.setBinary(firefox.Channel.AURORA); // Set Developer Edition | |
const driver = new webdriver.Builder() | |
.forBrowser('firefox') | |
.setFirefoxOptions(firefoxOption) | |
.build(); | |
(async function() { | |
await driver.installAddon(XPI_PATH); | |
})(); | |
// You can start work with driver now... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment