mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 06:20: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
|
||||
if ("document" in self && document.currentScript) {
|
||||
if ("document" in self && document?.currentScript) {
|
||||
document.currentScript.remove();
|
||||
}
|
||||
EOF
|
||||
|
|
|
@ -306,6 +306,7 @@ export default function (client: ScramjetClient, self: typeof window) {
|
|||
"Node.prototype.parentElement",
|
||||
"Node.prototype.previousSibling",
|
||||
"Node.prototype.nextSibling",
|
||||
"Node.prototype.getRootNode",
|
||||
],
|
||||
{
|
||||
get(ctx) {
|
||||
|
|
|
@ -38,6 +38,6 @@ if (!(SCRAMJETCLIENT in <Partial<typeof self>>self)) {
|
|||
client.frame?.dispatchEvent(ev);
|
||||
}
|
||||
|
||||
if ("document" in self && document.currentScript) {
|
||||
if ("document" in self && document?.currentScript) {
|
||||
document.currentScript.remove();
|
||||
}
|
||||
|
|
|
@ -63,6 +63,11 @@ export default function (client: ScramjetClient, self: typeof globalThis) {
|
|||
if (typeof v === "string" && v.includes("scramjet")) {
|
||||
debugger;
|
||||
}
|
||||
|
||||
if (typeof v === "string" && v.includes(location.origin)) {
|
||||
debugger;
|
||||
}
|
||||
|
||||
if (iswindow && v instanceof Document && v.defaultView.$scramjet) {
|
||||
debugger;
|
||||
}
|
||||
|
|
|
@ -43,6 +43,6 @@ $scramjet.shared = {
|
|||
CookieStore,
|
||||
};
|
||||
|
||||
if ("document" in self && document.currentScript) {
|
||||
if ("document" in self && document?.currentScript) {
|
||||
document.currentScript.remove();
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ export function rewriteHtml(
|
|||
const injected = `
|
||||
self.COOKIE = ${dump};
|
||||
self.$scramjet.config = ${JSON.stringify($scramjet.config)};
|
||||
if ("document" in self && document.currentScript) {
|
||||
if ("document" in self && document?.currentScript) {
|
||||
document.currentScript.remove();
|
||||
}
|
||||
`;
|
||||
|
|
|
@ -10,6 +10,9 @@ const scramjet = new ScramjetController({
|
|||
"https://discord.com/.*": {
|
||||
naiiveRewriter: true,
|
||||
},
|
||||
"https://worker-playground.glitch.me/.*": {
|
||||
serviceworkers: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue