Skip to content

Commit 32a35d1

Browse files
committed
Add information for Chrome Extension
1 parent 667e991 commit 32a35d1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

sketch/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,20 @@ already implemented, like `hover`, you could want to define some specific
611611
selectors. In that case, look for
612612
[`css.selector()`](https://hexdocs.pm/sketch/sketch/css.selector)!
613613

614+
## Usagi with Chrome Extensions
615+
616+
At its core, Sketch uses Wasm to compute classes hash, to make sure there's no
617+
performance bottleneck. Unfortunately, Google is conservative on Wasm in Chrome
618+
Extension. To get Sketch running in Chrome Extension, you should put the
619+
following code in your `manifest.json`. This allows Chrome to load Wasm code in
620+
your extension!
621+
622+
```json
623+
"content_security_policy": {
624+
"extension_pages":"script-src 'self' 'wasm-unsafe-eval'; object-src 'self'"
625+
}
626+
```
627+
614628
## Integration
615629

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

0 commit comments

Comments
 (0)