mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-28 08:17:16 +00:00
Keep inline aspect-ratio on iframes so embeds like Inoreader’s YouTube player don’t collapse to 150px tall. Fixes #5479.
This commit is contained in:
1 parent
e59a7eda85
commit
cfa36a413a
1 file changed
+5
-1
@@ -43,7 +43,11 @@ function stripStyles() {
|
||||
document.getElementsByTagName("body")[0].querySelectorAll("style, link[rel=stylesheet]").forEach(element => element.remove());
|
||||
// Removing "background" and "font" will also remove properties that would be reflected in them, e.g., "background-color" and "font-family"
|
||||
// The stylesheet forces images to height: auto, so an author aspect-ratio box can't be filled by its image — content after the box overlaps the overflowing image.
|
||||
document.getElementsByTagName("body")[0].querySelectorAll("[style]").forEach(element => stripStylesFromElement(element, ["color", "background", "font", "max-width", "max-height", "position", "aspect-ratio"]));
|
||||
// Iframes keep their aspect-ratio: without it an iframe with no pixel height collapses to the default 150px.
|
||||
document.getElementsByTagName("body")[0].querySelectorAll("[style]").forEach(element => {
|
||||
const isIframe = element.tagName === "IFRAME";
|
||||
stripStylesFromElement(element, isIframe ? ["color", "background", "font", "max-width", "max-height", "position"] : ["color", "background", "font", "max-width", "max-height", "position", "aspect-ratio"]);
|
||||
});
|
||||
}
|
||||
|
||||
// Constrain the height of iframes whose heights are defined relative to the document body to be at most
|
||||
|
||||
Reference in new issue
Block a user