Finds a Google Chrome extension by name
npm install --save find-chrome-extension
const findChromeExtension = require('find-chrome-extension');
const dir = findChromeExtension('React Developer Tools');
console.log(dir);
The console.log
statement should print the directory containing the extension (if found). Example: /Users/frank/Library/Application Support/Google/Chrome/Profile 3/Extensions/fmkadmapgofadopljbjfkapdkoienihi/3.6.0_0
. The findChromeExtension
function returns null if not found.
Currently, this utility works on Windows, macOS, and Linux. It searches the Default
as well as all Profile
directories.
- Install the React Developer Tools Google Chrome extension.
- Run
npm install
to install the Mocha dev dependency. - Run
npm test
to run the test.
I wanted a utility whereby I could install the React Developer Tools in Electron using the BrowswerWindow addDevToolsExtension
method.
- Another option would have been to find the extension by ID but that would have added another step for the developer (i.e., determining the extension ID from the extension URL).
- It looks in all profiles and doesn't check the version number. It simply returns the first extension matching the name.