Optimize renderer security

This commit is contained in:
2024-02-01 17:52:44 +08:00
parent 2b566aeb85
commit a7df95a613
3 changed files with 12 additions and 43 deletions

View File

@@ -8,14 +8,6 @@
</head>
<body>
<script>
window.addEventListener("error", (e) => {
window.parent.postMessage({ type: "ERROR", msg: e.message });
});
window.addEventListener("load", () => {
window.parent.postMessage({ type: "LOADED", msg: "" });
});
window.addEventListener("message", ({ data }) => {
if (data?.type === "UPDATE") {
// Record old styles that need to be removed
@@ -43,7 +35,6 @@
};
document.body.appendChild(script);
URL.revokeObjectURL(oldSrc);
window.parent.postMessage({ type: "DONE", msg: "" });
}
});
</script>