mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 22:40:01 -04:00
do the stupid skibidi hack
This commit is contained in:
parent
797607aabb
commit
91604fc6bb
3 changed files with 30 additions and 7 deletions
|
@ -70,7 +70,12 @@ export default function (client: ScramjetClient, self: typeof window) {
|
||||||
} else if (
|
} else if (
|
||||||
["src", "data", "href", "action", "formaction"].includes(attr)
|
["src", "data", "href", "action", "formaction"].includes(attr)
|
||||||
) {
|
) {
|
||||||
|
if (element === HTMLMediaElement && value.startsWith("blob:")) {
|
||||||
|
let origin = new URL(value.substring("blob:".length));
|
||||||
|
value = "blob:" + location.origin + origin.pathname;
|
||||||
|
} else {
|
||||||
value = encodeUrl(value, client.meta);
|
value = encodeUrl(value, client.meta);
|
||||||
|
}
|
||||||
} else if (attr === "srcdoc") {
|
} else if (attr === "srcdoc") {
|
||||||
value = rewriteHtml(
|
value = rewriteHtml(
|
||||||
value,
|
value,
|
||||||
|
|
|
@ -17,10 +17,4 @@ export default function (client: ScramjetClient) {
|
||||||
return log;
|
return log;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
client.Proxy("URL.revokeObjectURL", {
|
|
||||||
apply(ctx) {
|
|
||||||
ctx.return(undefined);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
24
src/client/shared/blob.ts
Normal file
24
src/client/shared/blob.ts
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
import { ScramjetClient } from "../client";
|
||||||
|
const realf = fetch;
|
||||||
|
export default function (client: ScramjetClient) {
|
||||||
|
client.Proxy("URL.revokeObjectURL", {
|
||||||
|
apply(ctx) {
|
||||||
|
ctx.return(undefined);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
client.Proxy("URL.createObjectURL", {
|
||||||
|
apply(ctx) {
|
||||||
|
const url: string = ctx.call();
|
||||||
|
// additional origin concealer. also you need this for youtube for some fucking reason
|
||||||
|
|
||||||
|
const start = "blob:" + location.origin;
|
||||||
|
if (url.startsWith(start)) {
|
||||||
|
const id = url.substring(start.length);
|
||||||
|
ctx.return("blob:" + client.url.origin + id);
|
||||||
|
} else {
|
||||||
|
ctx.return(url);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue