Skip to content

Commit

Permalink
Add information for Chrome Extension
Browse files Browse the repository at this point in the history
  • Loading branch information
ghivert committed Jan 17, 2025
1 parent 667e991 commit 32a35d1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions sketch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,20 @@ already implemented, like `hover`, you could want to define some specific
selectors. In that case, look for
[`css.selector()`](https://hexdocs.pm/sketch/sketch/css.selector)!

## Usagi with Chrome Extensions

At its core, Sketch uses Wasm to compute classes hash, to make sure there's no
performance bottleneck. Unfortunately, Google is conservative on Wasm in Chrome
Extension. To get Sketch running in Chrome Extension, you should put the
following code in your `manifest.json`. This allows Chrome to load Wasm code in
your extension!

```json
"content_security_policy": {
"extension_pages":"script-src 'self' 'wasm-unsafe-eval'; object-src 'self'"
}
```

## Integration

> This part is new, and subject to modification. Because nobody integrated
Expand Down

0 comments on commit 32a35d1

Please sign in to comment.