diff --git a/src/client/dom/element.ts b/src/client/dom/element.ts index 2717144..6895634 100644 --- a/src/client/dom/element.ts +++ b/src/client/dom/element.ts @@ -70,7 +70,12 @@ export default function (client: ScramjetClient, self: typeof window) { } else if ( ["src", "data", "href", "action", "formaction"].includes(attr) ) { - value = encodeUrl(value, client.meta); + 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, diff --git a/src/client/shared/antiantidebugger.ts b/src/client/shared/antiantidebugger.ts index 7ef40b3..e119afd 100644 --- a/src/client/shared/antiantidebugger.ts +++ b/src/client/shared/antiantidebugger.ts @@ -17,10 +17,4 @@ export default function (client: ScramjetClient) { return log; }, }); - - client.Proxy("URL.revokeObjectURL", { - apply(ctx) { - ctx.return(undefined); - }, - }); } diff --git a/src/client/shared/blob.ts b/src/client/shared/blob.ts new file mode 100644 index 0000000..a20a043 --- /dev/null +++ b/src/client/shared/blob.ts @@ -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); + } + }, + }); +}