Port inline style stripping changes from master
This commit is contained in:
parent
85bd20ca80
commit
65b508ffaa
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue