Releases: straker/browser-driver-manager
v2.0.1
v2.0.0
Breaking Change
V1 use to detect the version of Chrome installed on the system and install the corresponding version of the chromedriver npm package. However this had problems as the chromedriver package wasn't always up-to-date with the latest version so when Chrome updated to the next version, the chromedriver package could lag behind and still cause out-of-sync issues. Additionally the chromedriver package didn't always have the latest versions of non-stable channels so asking for Chrome Canary wasn't always reliable.
V2 uses the newly released Chrome for Testing to manage Chrome. This enables both installing specific versions of Chrome and fixes the previous chromedriver package issue. V2 utilizes the puppeteer/browser
script to manage the installation of Chrome and Chromedriver as it can handle downloading the binaries (and the multiple changes to the chromedriver download URL). This means that v2 no longer uses the chromedriver npm package to get chromedriver.
Once installed, a directory is created in your home directory called .browser-driver-manager
. The directory will contain a .env
file which will list the install path of both Chrome and Chromedriver under CHROME_TEST_PATH
and CHROMEDRIVER_TEST_PATH
respectively.
# ~/.browser-driver-manager/.env
CHROME_TEST_PATH="~/.browser-driver-manager/chrome/mac_arm-125.0.6422.141/chrome-mac-arm64/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing"
CHROMEDRIVER_TEST_PATH="~/.browser-driver-manager/chromedriver/mac_arm-125.0.6422.141/chromedriver-mac-arm64/chromedriver"
This means in v2 you'll need to grab the Chromedriver path from the ~/.browser-driver-manager/.env
file and not from the chromedriver npm package. Additionally, you'll need to grab the Chrome path pass the path to any browser driver, such as Webdriver.
Here's an example of grabbing the Chromedriver path in v1 and the change for v2.
// v1
const chromedriver = require('chromedriver');
console.log(chromedriver.path);
// v2
require('dotenv').config({ path: '.browser-driver-manager/.env' })
console.log(process.env.CHROMEDRIVER_TEST_PATH);