1.0.4 • Published 7 years ago
find-chrome-extension v1.0.4
find-chrome-extension
Finds a Google Chrome extension by name
Installation
npm install --save find-chrome-extensionUsage
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.
Platforms
Currently, this utility works on Windows, macOS, and Linux. It searches the Default as well as all Profile directories.
Test
- Install the React Developer Tools Google Chrome extension.
- Run
npm installto install the Mocha dev dependency. - Run
npm testto run the test.
Motivation
I wanted a utility whereby I could install the React Developer Tools in Electron using the BrowswerWindow addDevToolsExtension method.
Notes
- 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.