mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
This commit is contained in:
@@ -333,6 +333,9 @@ private extension ArticleRenderer {
|
||||
anchors[i].addEventListener("mouseenter", function() { mouseDidEnterLink(this) });
|
||||
anchors[i].addEventListener("mouseleave", function() { mouseDidExitLink(this) });
|
||||
}
|
||||
|
||||
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 mouseDidEnterLink(anchor) {
|
||||
@@ -367,7 +370,20 @@ private extension ArticleRenderer {
|
||||
s += "<meta name=\"viewport\" content=\"width=device-width\">\n"
|
||||
s += title.htmlBySurroundingWithTag("title")
|
||||
s += styleString().htmlBySurroundingWithTag("style")
|
||||
s += "\n\n</head><body>\n\n"
|
||||
s += """
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function startup() {
|
||||
document.getElementsByTagName("body")[0].querySelectorAll("style, link[rel=stylesheet]").forEach(element => element.remove());
|
||||
document.getElementsByTagName("body")[0].querySelectorAll("[style]").forEach(element => element.removeAttribute("style"));
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
"""
|
||||
|
||||
s += "\n\n</head><body onload='startup()'>\n\n"
|
||||
s += body
|
||||
s += "\n\n</body></html>"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user