fix: 区分Mac平台 采用旧的剪贴板监听方式

This commit is contained in:
ZiuChen
2022-09-21 16:33:02 +08:00
parent d5332e69af
commit b4dc9f803b
7 changed files with 75 additions and 27 deletions

2
public/time.worker.js Normal file
View File

@@ -0,0 +1,2 @@
// time.worker.js author: inu1255
const apis={sleep(ms){return new Promise(resolve=>setTimeout(resolve,ms))}};onmessage=event=>{const data=event.data;if(!data)return;const{cb,method,args}=data;if(!apis[method]){postMessage({cb:cb,err:"no such method"});return}apis[method].apply(null,args).then(res=>postMessage({cb:cb,data:res}),err=>postMessage({cb:cb,err:err}))};