Fix spoof-css for Firefox

This commit is contained in:
Raymond Hill 2023-05-24 16:50:34 -04:00
parent 005a0fe95d
commit 796ebc2444
No known key found for this signature in database
GPG key ID: 25E1490B761470C2

View file

@ -2261,6 +2261,11 @@ function spoofCSS(
const proxiedStyle = new Proxy(style, {
get(target, prop, receiver) {
if ( typeof target[prop] === 'function' ) {
if ( prop === 'getPropertyValue' ) {
return (function(prop) {
return spoofStyle(prop, target[prop]);
}).bind(target);
}
return target[prop].bind(target);
}
return spoofStyle(prop, Reflect.get(target, prop, receiver));