fix: add back proper get to descriptor

This commit is contained in:
Percs 2024-11-01 10:30:10 -05:00
parent 8c8f0c32a7
commit 4df140d1b7

View file

@ -55,9 +55,17 @@ export default function (client: ScramjetClient, self: typeof window) {
for (const attr of attrs) {
for (const element of attrObject[attr]) {
const descriptor = nativeGetOwnPropertyDescriptor(
element.prototype,
attr
);
Object.defineProperty(element.prototype, attr, {
get() {
return this.getAttribute(attr);
if (["src", "data", "href", "action", "formaction"].includes(attr)) {
return unrewriteUrl(descriptor.get.call(this));
}
return descriptor.get.call(this);
},
set(value) {