Skip to content

Commit b5edea6

Browse files
Update Chrome Extension using WebGPU Service Worker README.md (mlc-ai#336)
This PR updates Chrome Extension using WebGPU Service Worker README.md following gpuweb/gpuweb#4197 (comment)
1 parent a368eb6 commit b5edea6

File tree

1 file changed

+9
-5
lines changed
  • examples/chrome-extension-webgpu-service-worker

1 file changed

+9
-5
lines changed

examples/chrome-extension-webgpu-service-worker/README.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@
22

33
![Chrome Extension](https://github.com/mlc-ai/mlc-llm/assets/11940172/0d94cc73-eff1-4128-a6e4-70dc879f04e0)
44

5-
- Chrome has added WebGPU support in Service Worker in this [commit](https://chromium-review.googlesource.com/c/chromium/src/+/5190750). This example shows how we can create a Chrome extension using WebGPU and service worker.
6-
The project structure is as follows:
5+
6+
> [!WARNING]
7+
> Service worker support in WebGPU is enabled by default in [Chrome 124](https://chromiumdash.appspot.com/commit/8d78510e4aca5ac3cd8ee4a33e96b404eaa43246).
8+
> If you are using Chrome 123, go to `chrome://flags/#enable-experimental-web-platform-features`, enable the `#enable-experimental-web-platform-features` flag, and **relaunch the browser**.
9+
10+
This example shows how we can create a Chrome extension using WebGPU and service worker.
11+
12+
- The project structure is as follows:
713
- `manifest.json`: A required file that lists important information about the structure and behavior of that extension. Here we are using manifest V3.
814
- `popup.ts`: Script of the extension pop-up window.
915
- `background.ts`: Script of the service worker. An extension service worker is loaded when it is needed, and unloaded when it goes dormant.
1016
- `content.js`: Content script that interacts with DOM.
11-
- To run the extension, first make sure you are on [Google Chrome Canary](https://www.google.com/chrome/canary/).
12-
- In Chrome Canary, go to `chrome://flags/#enable-experimental-web-platform-features` and enable the `#enable-experimental-web-platform-features` flag. **Relaunch the browser**.
1317
- Run
1418
```bash
1519
npm install
@@ -22,4 +26,4 @@ The project structure is as follows:
2226
To enable it, set `useContext` in `popup.ts` to `true`. More info about this feature can be found
2327
[here](https://github.com/mlc-ai/web-llm/pull/190).
2428
However, if the web content is too large, it might run into issues. We recommend using `example.html` to
25-
test this feature.
29+
test this feature.

0 commit comments

Comments
 (0)