mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 22:40: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", {
|
||||
get(ctx) {
|
||||
const realwin = ctx.get() as Window;
|
||||
|
|
|
@ -280,11 +280,11 @@ export function rewriteSrcset(srcset: string, meta: URLMeta) {
|
|||
return rewrittenUrls.join("");
|
||||
}
|
||||
|
||||
function _base64ToBytes(base64) {
|
||||
const binString = atob(base64);
|
||||
// function base64ToBytes(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) {
|
||||
const binString = Array.from(bytes, (byte) =>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue