File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 36
36
"background" : {
37
37
"service_worker" : " src/chrome/background.ts" ,
38
38
"type" : " module"
39
+ },
40
+ "content_security_policy" : {
41
+ "extension_pages" : " script-src 'self' 'wasm-unsafe-eval'; object-src 'self';" ,
42
+ "sandbox" : " sandbox allow-scripts allow-forms allow-popups allow-modals; script-src 'self' 'unsafe-inline' 'unsafe-eval'; child-src 'self';"
39
43
}
40
44
}
Original file line number Diff line number Diff line change 36
36
},
37
37
"scripts" : {
38
38
"start" : " vite" ,
39
+ "install:rust" : " curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh" ,
40
+ "install:wasm" : " curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh" ,
39
41
"build:wasm:dev" : " (cd src/wasm-lib && wasm-pack build --dev --target web --out-dir pkg) && cp src/wasm-lib/pkg/wasm_lib_bg.wasm public" ,
40
42
"build:wasm" : " (cd src/wasm-lib && wasm-pack build --target web --out-dir pkg) && cp src/wasm-lib/pkg/wasm_lib_bg.wasm public" ,
41
43
"build" : " vite build" ,
Original file line number Diff line number Diff line change @@ -65,7 +65,9 @@ async function initialiseWasm() {
65
65
const fullUrl = '/wasm_lib_bg.wasm'
66
66
const input = await fetch ( fullUrl )
67
67
const buffer = await input . arrayBuffer ( )
68
- return await init ( buffer )
68
+ const output = await init ( buffer )
69
+ console . log ( 'Wasm loaded: ' , output )
70
+ return output
69
71
} catch ( e ) {
70
72
console . log ( 'Error initialising WASM' , e )
71
73
throw e
You can’t perform that action at this time.
0 commit comments