mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-16 15:40:02 -04:00
fix: add back proper get to descriptor
This commit is contained in:
parent
8c8f0c32a7
commit
4df140d1b7
1 changed files with 9 additions and 1 deletions
|
@ -55,9 +55,17 @@ export default function (client: ScramjetClient, self: typeof window) {
|
||||||
|
|
||||||
for (const attr of attrs) {
|
for (const attr of attrs) {
|
||||||
for (const element of attrObject[attr]) {
|
for (const element of attrObject[attr]) {
|
||||||
|
const descriptor = nativeGetOwnPropertyDescriptor(
|
||||||
|
element.prototype,
|
||||||
|
attr
|
||||||
|
);
|
||||||
Object.defineProperty(element.prototype, attr, {
|
Object.defineProperty(element.prototype, attr, {
|
||||||
get() {
|
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) {
|
set(value) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue