This commit is contained in:
zhu
2026-04-30 11:03:26 +08:00
parent 48ce6a8b0b
commit 08a6a69bd6
9 changed files with 566 additions and 42 deletions

View File

@@ -1,7 +1,7 @@
import { createApp } from 'vue';
import App from './App.vue';
/** 将内容脚本应用挂载到页面的 Shadow DOM 中。 */
/** 将内容脚本应用挂载到页面中。 */
function mountApp() {
if (document.getElementById('dianshan-crx-root')) {
return;
@@ -9,11 +9,10 @@ function mountApp() {
const container = document.createElement('div');
container.id = 'dianshan-crx-root';
const shadowRoot = container.attachShadow({ mode: 'open' });
const appRoot = document.createElement('div');
shadowRoot.appendChild(appRoot);
document.documentElement.appendChild(container);
container.appendChild(appRoot);
document.body.appendChild(container);
createApp(App).mount(appRoot);
}