Skip to content

Commit

Permalink
docs: update web store readme
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelmaddock committed Dec 21, 2024
1 parent 803b16a commit 72b3796
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 28 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ A minimal, tabbed web browser with support for Chrome extensions—built on Elec

## Packages

| Name | Description |
| --- | --- |
| [shell](./packages/shell) | A minimal, tabbed web browser used as a testbed for development of Chrome extension support. |
| [electron-chrome-extensions](./packages/electron-chrome-extensions) | Adds additional API support for Chrome extensions to Electron. |
| [electron-chrome-context-menu](./packages/electron-chrome-context-menu) | Chrome context menu for Electron browsers. |
| [electron-chrome-web-store](./packages/electron-chrome-web-store) | Download extensions from the Chrome Web Store in Electron. |
| Name | Description |
| ----------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| [shell](./packages/shell) | A minimal, tabbed web browser used as a testbed for development of Chrome extension support. |
| [electron-chrome-extensions](./packages/electron-chrome-extensions) | Adds additional API support for Chrome extensions to Electron. |
| [electron-chrome-context-menu](./packages/electron-chrome-context-menu) | Chrome context menu for Electron browsers. |
| [electron-chrome-web-store](./packages/electron-chrome-web-store) | Download extensions from the Chrome Web Store in Electron. |

## Usage

Expand Down Expand Up @@ -39,16 +39,17 @@ Load unpacked extensions into `./extensions` then launch the browser.
- [x] Initial [extension popup](https://developer.chrome.com/extensions/browserAction) support
- [x] .CRX extension loader
- [x] [Chrome Web Store](https://chromewebstore.google.com) extension installer
- [ ] [Manifest V3](https://developer.chrome.com/docs/extensions/mv3/intro/) support
- [x] Automatic extension updates
- [ ] [Manifest V3](https://developer.chrome.com/docs/extensions/mv3/intro/) support—pending [electron/electron#44411](https://github.com/electron/electron/pull/44411)
- [ ] Support for common [`chrome.*` extension APIs](https://developer.chrome.com/extensions/devguide)
- [ ] Robust extension popup support
- [ ] Respect extension manifest permissions

### 🤞 Eventually

- [ ] Extension management (enable/disable/uninstall)
- [ ] Installation prompt UX
- [ ] [Microsoft Edge Add-ons](https://microsoftedge.microsoft.com/addons/Microsoft-Edge-Extensions-Home) extension installer
- [ ] Automatic extension updates
- [ ] Full support of [`chrome.*` extension APIs](https://developer.chrome.com/extensions/devguide)

### 🤔 Considering
Expand Down
28 changes: 8 additions & 20 deletions packages/electron-chrome-web-store/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,19 @@ Install and manage Chrome extensions from the Chrome Web Store.
const { app, BrowserWindow, session } = require('electron')
const { installChromeWebStore } = require('electron-chrome-web-store')

async function main() {
await app.whenReady()

app.whenReady().then(async () => {
const browserSession = session.defaultSession
const browserWindow = new BrowserWindow({
webPreferences: {
session: browserSession,
},
})

installChromeWebStore({ session: browserSession })
// Install Chrome web store and wait for extensions to load
await installChromeWebStore({ session: browserSession })

browserWindow.loadURL('https://chromewebstore.google.com/')
}

main()
})
```

To enable full support for Chrome extensions in Electron, install [electron-chrome-extensions](https://www.npmjs.com/package/electron-chrome-extensions).
Expand All @@ -37,7 +34,8 @@ Installs Chrome Web Store support in the specified session.
- `options`: An object with the following properties:
- `session`: The Electron session to enable the Chrome Web Store in. Defaults to `session.defaultSession`.
- `modulePath`: The path to the 'electron-chrome-web-store' module.
- `extensionsPath`: The path to the extensions directory. Defaults to 'Extensions/' under the app's userData path.
- `extensionsPath`: The path to the extensions directory. Defaults to 'Extensions/' in the app's userData path.
- `autoUpdate`: Whether to auto-update web store extensions at startup and once every 5 hours. Defaults to true.
- `loadExtensions`: A boolean indicating whether to load extensions installed by Chrome Web Store. Defaults to true.
- `allowUnpackedExtensions`: A boolean indicating whether to allow loading unpacked extensions. Only loads if `loadExtensions` is also enabled. Defaults to false.
- `allowlist`: An array of allowed extension IDs to install.
Expand All @@ -52,18 +50,8 @@ Loads all extensions from the specified directory.
- `options`: An object with the following property:
- `allowUnpacked`: A boolean indicating whether to allow loading unpacked extensions. Defaults to false.

> [!NOTE] \
> `installChromeWebStore` will automatically load installed extensions as long as the `loadExtensions` property is set to `true`.
### `downloadExtension`

Downloads an extension from the Chrome Web Store to the specified destination directory.

- `extensionId`: The ID of the extension to download.
- `destDir`: The destination directory where the extension will be downloaded. The directory is expected to exist.

> [!TIP]
> This API is designed to work in Node or Electron.
> [!NOTE]
> The `installChromeWebStore` API will automatically load web store extensions by default.
## License

Expand Down

0 comments on commit 72b3796

Please sign in to comment.