2019-09-20 20:33:28 -05:00

35 lines
1.1 KiB
HTML

<html>
<head>
<meta name="viewport" content="width=device-width">
<style>
:root {
color-scheme: light dark;
}
</style>
<script>
function mouseDidEnterLink(anchor) {
window.webkit.messageHandlers.mouseDidEnter.postMessage(anchor.href);
}
function mouseDidExitLink(anchor) {
window.webkit.messageHandlers.mouseDidExit.postMessage(anchor.href);
}
function render(data) {
document.getElementsByTagName("style")[0].innerHTML = data.style;
document.body.innerHTML = data.body;
window.scrollTo(0, 0);
document.getElementsByTagName("body")[0].querySelectorAll("style, link[rel=stylesheet]").forEach(element => element.remove());
document.getElementsByTagName("body")[0].querySelectorAll("[style]").forEach(element => element.removeAttribute("style"));
}
function error() {
document.body.innerHTML = "error";
}
</script>
</head>
<body>
</body>
</html>