Add poster attribute rewriting

This commit is contained in:
wearrrrr 2024-07-29 23:54:23 -05:00
parent f9e7fc76d9
commit e789a14592
2 changed files with 5 additions and 2 deletions

View file

@ -185,7 +185,9 @@ export default function (client: ScramjetClient, self: typeof window) {
}, },
}); });
} }
} catch (e) {} } catch (e) {
console.log(e);
}
} }
} }
} }

View file

@ -37,7 +37,7 @@ function traverseParsedHtml(node, origin?: URL) {
} }
/* url attributes */ /* url attributes */
for (const urlAttr of ["src", "href", "action", "formaction"]) { for (const urlAttr of ["src", "href", "action", "formaction", "poster"]) {
if ( if (
hasAttrib(node, urlAttr) && hasAttrib(node, urlAttr) &&
!isScramjetFile(node.attribs[urlAttr]) && !isScramjetFile(node.attribs[urlAttr]) &&
@ -52,6 +52,7 @@ function traverseParsedHtml(node, origin?: URL) {
"form", "form",
"media", "media",
"source", "source",
"video",
].includes(node.name) ].includes(node.name)
) { ) {
const value = node.attribs[urlAttr]; const value = node.attribs[urlAttr];