boot.ts

22 lines | 708 B Blame History Raw Download
import './app.less';
import bootHtml from './app.html';
import { watchConsole } from './injects/watch-console';
import { setOnErrorListener } from './injects/on-error';
import { createScript } from '../shared/create-script';
import { messageListener } from '../shared/message-listener';
import { postMessage, postResponseMessage } from '../shared/post-message';


document.body.innerHTML += bootHtml;
watchConsole((type, value) => {
    postMessage(parent, type, value);
});
messageListener((type, value, id) => {
    if (type == "script") {
        createScript(value);
        postResponseMessage(parent, id, value);
    }
});
setOnErrorListener((type, value) => {
    postMessage(parent, type, value);
});