diff --git a/src/client/css.ts b/src/client/css.ts index 4c14178..1490622 100644 --- a/src/client/css.ts +++ b/src/client/css.ts @@ -1,8 +1,7 @@ import { rewriteCss } from "./shared"; const cssProperties = ["background", "background-image", "mask", "mask-image", "list-style", "list-style-image", "border-image", "border-image-source", "cursor"]; -const jsProperties = ["background", "backgroundImage", "mask", "maskImage", "listStyle", "listStyleImage", "borderImage", "borderImageSource", "cursor"]; - +// const jsProperties = ["background", "backgroundImage", "mask", "maskImage", "listStyle", "listStyleImage", "borderImage", "borderImageSource", "cursor"]; CSSStyleDeclaration.prototype.setProperty = new Proxy(CSSStyleDeclaration.prototype.setProperty, { apply(target, thisArg, argArray) { @@ -10,17 +9,4 @@ CSSStyleDeclaration.prototype.setProperty = new Proxy(CSSStyleDeclaration.protot return Reflect.apply(target, thisArg, argArray); }, -}); - -jsProperties.forEach((prop) => { - const propDescriptor = Object.getOwnPropertyDescriptor(CSSStyleDeclaration.prototype, prop); - - Object.defineProperty(CSSStyleDeclaration.prototype, prop, { - get() { - return propDescriptor.get.call(this); - }, - set(v) { - return propDescriptor.set.call(this, rewriteCss(v)); - }, - }) }); \ No newline at end of file diff --git a/src/client/window.ts b/src/client/window.ts index 7fb3ac4..47a67f4 100644 --- a/src/client/window.ts +++ b/src/client/window.ts @@ -9,6 +9,14 @@ export const windowProxy = new Proxy(window, { return windowProxy; } else if (propIsString && prop === "$scramjet") { return; + } else if (propIsString && prop === "addEventListener") { + console.log("addEventListener getteetetetetet") + + return new Proxy(window.addEventListener, { + apply(target1, thisArg, argArray) { + window.addEventListener(argArray[0], argArray[1]); + }, + }) } return target[prop];