2022-06-30 20:12:43 +00:00
|
|
|
import * as kernel from "libkernel";
|
|
|
|
import * as skynet from "libskynet";
|
|
|
|
|
|
|
|
// @ts-ignore
|
2022-07-20 18:05:20 +00:00
|
|
|
window.kernel = kernel;
|
2022-06-30 20:12:43 +00:00
|
|
|
// @ts-ignore
|
2022-07-20 18:05:20 +00:00
|
|
|
window.skynet = skynet;
|
2023-03-31 19:42:33 +00:00
|
|
|
|
|
|
|
window.addEventListener("message", (event) => {
|
|
|
|
const data = event.data?.data;
|
|
|
|
if (event.data.method === "log") {
|
|
|
|
if (data?.isErr === false) {
|
|
|
|
console.log(data.message);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
console.error(data.message);
|
|
|
|
}
|
|
|
|
});
|