2019-09-19 07:03:23 +02:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<style>
|
|
|
|
</style>
|
|
|
|
<script>
|
2019-09-19 07:53:25 +02:00
|
|
|
function mouseDidEnterLink(anchor) {
|
|
|
|
window.webkit.messageHandlers.mouseDidEnter.postMessage(anchor.href);
|
|
|
|
}
|
2019-09-19 07:03:23 +02:00
|
|
|
|
2019-09-19 07:53:25 +02:00
|
|
|
function mouseDidExitLink(anchor) {
|
|
|
|
window.webkit.messageHandlers.mouseDidExit.postMessage(anchor.href);
|
|
|
|
}
|
2019-09-19 07:03:23 +02:00
|
|
|
|
|
|
|
function render(data) {
|
2019-09-21 02:28:13 +02:00
|
|
|
document.getElementsByTagName("style")[0].innerHTML = data.style;
|
2019-09-19 07:03:23 +02:00
|
|
|
document.body.innerHTML = data.body;
|
2019-09-19 07:53:25 +02:00
|
|
|
window.scrollTo(0, 0);
|
|
|
|
var anchors = document.getElementsByTagName("a");
|
|
|
|
for (var i = 0; i < anchors.length; i++) {
|
|
|
|
anchors[i].addEventListener("mouseenter", function() { mouseDidEnterLink(this) });
|
|
|
|
anchors[i].addEventListener("mouseleave", function() { mouseDidExitLink(this) });
|
|
|
|
}
|
2019-09-19 07:03:23 +02:00
|
|
|
|
2019-09-19 07:53:25 +02:00
|
|
|
document.getElementsByTagName("body")[0].querySelectorAll("style, link[rel=stylesheet]").forEach(element => element.remove());
|
|
|
|
document.getElementsByTagName("body")[0].querySelectorAll("[style]").forEach(element => element.removeAttribute("style"));
|
2019-09-19 07:03:23 +02:00
|
|
|
}
|
|
|
|
|
2019-09-19 07:53:25 +02:00
|
|
|
function error() {
|
|
|
|
document.body.innerHTML = "error";
|
|
|
|
}
|
2019-09-19 07:03:23 +02:00
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
</body>
|
|
|
|
</html>
|