mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 14:30:02 -04:00
fix: proxy Node.getRootNode
This commit is contained in:
parent
a2af4d7f3b
commit
ee85b48d33
7 changed files with 13 additions and 4 deletions
|
@ -36,7 +36,7 @@ mkdir dist/ || true
|
||||||
{
|
{
|
||||||
|
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
if ("document" in self && document.currentScript) {
|
if ("document" in self && document?.currentScript) {
|
||||||
document.currentScript.remove();
|
document.currentScript.remove();
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
|
@ -306,6 +306,7 @@ export default function (client: ScramjetClient, self: typeof window) {
|
||||||
"Node.prototype.parentElement",
|
"Node.prototype.parentElement",
|
||||||
"Node.prototype.previousSibling",
|
"Node.prototype.previousSibling",
|
||||||
"Node.prototype.nextSibling",
|
"Node.prototype.nextSibling",
|
||||||
|
"Node.prototype.getRootNode",
|
||||||
],
|
],
|
||||||
{
|
{
|
||||||
get(ctx) {
|
get(ctx) {
|
||||||
|
|
|
@ -38,6 +38,6 @@ if (!(SCRAMJETCLIENT in <Partial<typeof self>>self)) {
|
||||||
client.frame?.dispatchEvent(ev);
|
client.frame?.dispatchEvent(ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("document" in self && document.currentScript) {
|
if ("document" in self && document?.currentScript) {
|
||||||
document.currentScript.remove();
|
document.currentScript.remove();
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,6 +63,11 @@ export default function (client: ScramjetClient, self: typeof globalThis) {
|
||||||
if (typeof v === "string" && v.includes("scramjet")) {
|
if (typeof v === "string" && v.includes("scramjet")) {
|
||||||
debugger;
|
debugger;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (typeof v === "string" && v.includes(location.origin)) {
|
||||||
|
debugger;
|
||||||
|
}
|
||||||
|
|
||||||
if (iswindow && v instanceof Document && v.defaultView.$scramjet) {
|
if (iswindow && v instanceof Document && v.defaultView.$scramjet) {
|
||||||
debugger;
|
debugger;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,6 @@ $scramjet.shared = {
|
||||||
CookieStore,
|
CookieStore,
|
||||||
};
|
};
|
||||||
|
|
||||||
if ("document" in self && document.currentScript) {
|
if ("document" in self && document?.currentScript) {
|
||||||
document.currentScript.remove();
|
document.currentScript.remove();
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ export function rewriteHtml(
|
||||||
const injected = `
|
const injected = `
|
||||||
self.COOKIE = ${dump};
|
self.COOKIE = ${dump};
|
||||||
self.$scramjet.config = ${JSON.stringify($scramjet.config)};
|
self.$scramjet.config = ${JSON.stringify($scramjet.config)};
|
||||||
if ("document" in self && document.currentScript) {
|
if ("document" in self && document?.currentScript) {
|
||||||
document.currentScript.remove();
|
document.currentScript.remove();
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -10,6 +10,9 @@ const scramjet = new ScramjetController({
|
||||||
"https://discord.com/.*": {
|
"https://discord.com/.*": {
|
||||||
naiiveRewriter: true,
|
naiiveRewriter: true,
|
||||||
},
|
},
|
||||||
|
"https://worker-playground.glitch.me/.*": {
|
||||||
|
serviceworkers: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue