mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 06:50:01 -04:00
proxy Element.prototype.insertAdjacentHTML, rust docs work perfectly now.
This commit is contained in:
parent
6705d0ba2b
commit
a748053085
2 changed files with 16 additions and 4 deletions
|
@ -237,6 +237,18 @@ export default function (client: ScramjetClient, self: typeof window) {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
client.Proxy("Element.prototype.insertAdjacentHTML", {
|
||||||
|
apply(ctx) {
|
||||||
|
if (ctx.args[1])
|
||||||
|
ctx.args[1] = rewriteHtml(
|
||||||
|
ctx.args[1],
|
||||||
|
client.cookieStore,
|
||||||
|
client.meta,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
client.Trap("HTMLIFrameElement.prototype.contentWindow", {
|
client.Trap("HTMLIFrameElement.prototype.contentWindow", {
|
||||||
get(ctx) {
|
get(ctx) {
|
||||||
const realwin = ctx.get() as Window;
|
const realwin = ctx.get() as Window;
|
||||||
|
|
|
@ -280,11 +280,11 @@ export function rewriteSrcset(srcset: string, meta: URLMeta) {
|
||||||
return rewrittenUrls.join("");
|
return rewrittenUrls.join("");
|
||||||
}
|
}
|
||||||
|
|
||||||
function _base64ToBytes(base64) {
|
// function base64ToBytes(base64) {
|
||||||
const binString = atob(base64);
|
// const binString = atob(base64);
|
||||||
|
|
||||||
return Uint8Array.from(binString, (m) => m.codePointAt(0));
|
// return Uint8Array.from(binString, (m) => m.codePointAt(0));
|
||||||
}
|
// }
|
||||||
|
|
||||||
function bytesToBase64(bytes: Uint8Array) {
|
function bytesToBase64(bytes: Uint8Array) {
|
||||||
const binString = Array.from(bytes, (byte) =>
|
const binString = Array.from(bytes, (byte) =>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue