Skip to content

Commit

Permalink
fixed init wasm got incorrect function
Browse files Browse the repository at this point in the history
  • Loading branch information
eric2788 committed Jan 10, 2024
1 parent 8b72800 commit ce1ea65
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/adapters/websocket-hook.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { injectFuncAsListener } from "~utils/event"
import { sendBLiveMessage } from "~utils/messaging"
import wasmUrl from "raw:~assets/brotli-dec.wasm"
import init from 'brotli-dec-wasm/pkg/index'
import init, { decompress as wasmDecompress } from 'brotli-dec-wasm/pkg/index'

var decompress = null

const loadWasm = init(wasmUrl).then(output => {
decompress = output.decompress
const loadWasm = init(wasmUrl).then(_ => {
decompress = wasmDecompress
console.info('wasm loaded.')
})

Expand Down
1 change: 1 addition & 0 deletions src/contents/index/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import styleText from '~styles';
import createApp from './mounter';

import '~toaster';
import '~logger';


export const config: PlasmoCSConfig = {
Expand Down
4 changes: 4 additions & 0 deletions src/logger.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
console.info = console.log.bind(console, '[bilibili-vup-stream-enhancer]')
console.warn = console.log.bind(console, '[bilibili-vup-stream-enhancer]')
console.error = console.log.bind(console, '[bilibili-vup-stream-enhancer]')
console.debug = console.log.bind(console, '[bilibili-vup-stream-enhancer]')

0 comments on commit ce1ea65

Please sign in to comment.