do the stupid skibidi hack

This commit is contained in:
velzie 2024-10-12 14:25:04 -04:00
parent 797607aabb
commit 91604fc6bb
3 changed files with 30 additions and 7 deletions

View file

@ -70,7 +70,12 @@ export default function (client: ScramjetClient, self: typeof window) {
} else if (
["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);
}
} else if (attr === "srcdoc") {
value = rewriteHtml(
value,

View file

@ -17,10 +17,4 @@ export default function (client: ScramjetClient) {
return log;
},
});
client.Proxy("URL.revokeObjectURL", {
apply(ctx) {
ctx.return(undefined);
},
});
}

24
src/client/shared/blob.ts Normal file
View 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);
}
},
});
}