diff --git a/src/content.js b/src/content.js index e38be56..7aa283e 100644 --- a/src/content.js +++ b/src/content.js @@ -9,6 +9,7 @@ import { MSG_TRANS_TOGGLE_STYLE, MSG_TRANS_GETRULE, MSG_TRANS_PUTRULE, + APP_LCNAME, } from "./config"; import { getSettingWithDefault, @@ -93,7 +94,7 @@ const init = async () => { const fab = await getFabWithDefault(); if (!fab.isHide) { const $action = document.createElement("div"); - $action.setAttribute("id", "kiss-translator"); + $action.setAttribute("id", APP_LCNAME); document.body.parentElement.appendChild($action); const shadowContainer = $action.attachShadow({ mode: "closed" }); const emotionRoot = document.createElement("style"); @@ -101,7 +102,7 @@ const init = async () => { shadowContainer.appendChild(emotionRoot); shadowContainer.appendChild(shadowRootElement); const cache = createCache({ - key: "kiss-translator", + key: APP_LCNAME, prepend: true, container: emotionRoot, }); diff --git a/src/userscript.js b/src/userscript.js index c1cf836..407b39b 100644 --- a/src/userscript.js +++ b/src/userscript.js @@ -15,6 +15,7 @@ import { MSG_TRANS_TOGGLE_STYLE, MSG_TRANS_GETRULE, MSG_TRANS_PUTRULE, + APP_LCNAME, } from "./config"; import { isIframe, sendIframeMsg, sendPrentMsg } from "./libs/iframe"; import { handlePing, injectScript } from "./libs/gm"; @@ -98,7 +99,7 @@ const init = async () => { // 浮球按钮 const fab = await getFabWithDefault(); const $action = document.createElement("div"); - $action.setAttribute("id", "kiss-translator"); + $action.setAttribute("id", APP_LCNAME); document.body.parentElement.appendChild($action); const shadowContainer = $action.attachShadow({ mode: "closed" }); const emotionRoot = document.createElement("style"); @@ -106,7 +107,7 @@ const init = async () => { shadowContainer.appendChild(emotionRoot); shadowContainer.appendChild(shadowRootElement); const cache = createCache({ - key: "kiss-translator", + key: APP_LCNAME, prepend: true, container: emotionRoot, });