1
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user