Harden `spoof-css` scriptlet

This commit is contained in:
Raymond Hill 2023-08-02 11:36:54 -04:00
parent 4bd562f3c2
commit 64b849ab0b
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 11 additions and 0 deletions

View File

@ -2897,6 +2897,17 @@ function spoofCSS(
}
return spoofStyle(prop, Reflect.get(target, prop, receiver));
},
getOwnPropertyDescriptor(target, prop) {
if ( propToValueMap.has(prop) ) {
return {
configurable: true,
enumerable: true,
value: propToValueMap.get(prop),
writable: true,
};
}
return Reflect.getOwnPropertyDescriptor(target, prop);
},
});
return proxiedStyle;
},