[feat] add plugin addCharaJS

This commit is contained in:
kwaroran
2023-11-11 13:26:58 +09:00
parent 8fe2da4aec
commit 55f508bff7
5 changed files with 88 additions and 27 deletions

View File

@@ -119,6 +119,17 @@
body: char
})
}
function addCharaJs(code:Function, position:'front'|'back' = 'back'){
const codeString = code.toString().replace(/.+?\{/, '{')
postMessage({
type: 'addCharaJs',
body: {
code: codeString,
position: position
}
})
}
async function handleOnmessage(data:{type:string,body:any}) {
if(!data.type){