mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Port inline style stripping changes from master
This commit is contained in:
@@ -324,6 +324,12 @@ private extension ArticleRenderer {
|
||||
s += """
|
||||
|
||||
<script type="text/javascript">
|
||||
function stripStylesFromElement(element, propertiesToStrip) {
|
||||
for (name of propertiesToStrip) {
|
||||
element.style.removeProperty(name);
|
||||
}
|
||||
}
|
||||
|
||||
var init = {
|
||||
wrapFrames: function () {
|
||||
document.querySelectorAll("iframe").forEach(element => {
|
||||
@@ -335,7 +341,7 @@ private extension ArticleRenderer {
|
||||
},
|
||||
stripStyles: function() {
|
||||
document.getElementsByTagName("body")[0].querySelectorAll("style, link[rel=stylesheet]").forEach(element => element.remove());
|
||||
document.getElementsByTagName("body")[0].querySelectorAll("[style]").forEach(element => element.removeAttribute("style"));
|
||||
document.getElementsByTagName("body")[0].querySelectorAll("[style]").forEach(element => stripStylesFromElement(element, ["color", "background", "font"]));
|
||||
},
|
||||
linkHover: function() {
|
||||
var anchors = document.getElementsByTagName("a");
|
||||
|
||||
Reference in New Issue
Block a user