mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 23:10:02 -04:00
Revert "feat: proxy node.prototype.textcontent"
This reverts commit e57a654ecc
.
totally broken implementation
This commit is contained in:
parent
e57a654ecc
commit
26b5b76f72
1 changed files with 1 additions and 32 deletions
|
@ -1,14 +1,11 @@
|
||||||
import { SCRAMJETCLIENT } from "../../symbols";
|
import { SCRAMJETCLIENT } from "../../symbols";
|
||||||
import { ScramjetClient } from "../client";
|
import { ScramjetClient } from "../client";
|
||||||
import { nativeGetOwnPropertyDescriptor } from "../natives";
|
import { nativeGetOwnPropertyDescriptor } from "../natives";
|
||||||
|
import { decodeUrl, htmlRules, unrewriteHtml } from "../../shared";
|
||||||
import {
|
import {
|
||||||
encodeUrl,
|
encodeUrl,
|
||||||
decodeUrl,
|
|
||||||
rewriteCss,
|
rewriteCss,
|
||||||
unrewriteCss,
|
|
||||||
htmlRules,
|
|
||||||
rewriteHtml,
|
rewriteHtml,
|
||||||
unrewriteHtml,
|
|
||||||
rewriteJs,
|
rewriteJs,
|
||||||
rewriteSrcset,
|
rewriteSrcset,
|
||||||
} from "../../shared";
|
} from "../../shared";
|
||||||
|
@ -163,34 +160,6 @@ export default function (client: ScramjetClient, self: typeof window) {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
client.Trap("Node.prototype.textContent", {
|
|
||||||
get(ctx) {
|
|
||||||
switch (ctx.this.tagName) {
|
|
||||||
case "SCRIPT":
|
|
||||||
return ctx.get();
|
|
||||||
case "STYLE":
|
|
||||||
return unrewriteCss(ctx.get() as string);
|
|
||||||
default:
|
|
||||||
return unrewriteHtml(ctx.get() as string);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
set(ctx) {
|
|
||||||
switch (ctx.this.tagName) {
|
|
||||||
case "SCRIPT":
|
|
||||||
return ctx.get();
|
|
||||||
case "STYLE":
|
|
||||||
return rewriteCss(ctx.get() as string, client.meta);
|
|
||||||
default:
|
|
||||||
return rewriteHtml(
|
|
||||||
ctx.get() as string,
|
|
||||||
client.cookieStore,
|
|
||||||
client.meta,
|
|
||||||
false
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
client.Trap("Element.prototype.innerHTML", {
|
client.Trap("Element.prototype.innerHTML", {
|
||||||
set(ctx, value: string) {
|
set(ctx, value: string) {
|
||||||
let newval;
|
let newval;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue