fix shadow dom

This commit is contained in:
Gabe Yuan
2023-08-24 14:57:54 +08:00
parent 792a1bfcad
commit a2762e6ce6
3 changed files with 78 additions and 40 deletions

View File

@@ -39,7 +39,7 @@ import { isGm } from "./libs/browser";
const $action = document.createElement("div");
$action.setAttribute("id", "kiss-translator");
document.body.parentElement.appendChild($action);
const shadowContainer = $action.attachShadow({ mode: "open" });
const shadowContainer = $action.attachShadow({ mode: "closed" });
const emotionRoot = document.createElement("style");
const shadowRootElement = document.createElement("div");
shadowContainer.appendChild(emotionRoot);