mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-05-31 22:51:22 +00:00
30 lines
701 B
HTML
30 lines
701 B
HTML
<html>
|
|
<head>
|
|
<meta content="text/html;charset=utf-8" http-equiv="Content-Type"/>
|
|
</head>
|
|
<body>
|
|
<pre id='output'>Loading scripts...</pre>
|
|
<script>
|
|
const wrap = method => {
|
|
const og = console[method];
|
|
const on_method = `on_console_${method}`;
|
|
console[method] = function (...args) {
|
|
if (window[on_method]) {
|
|
window[on_method](args);
|
|
}
|
|
og.apply(this, args);
|
|
};
|
|
};
|
|
|
|
wrap("debug");
|
|
wrap("log");
|
|
wrap("info");
|
|
wrap("warn");
|
|
wrap("error");
|
|
|
|
window.__wbg_test_invoke = f => f();
|
|
</script>
|
|
<script src='run.js' type=module></script>
|
|
</body>
|
|
</html>
|