antfu / vitesse-webext

⚡️ WebExtension Vite Starter Template

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How could I open the popup as a new window ?

Mikaleb opened this issue · comments

Vite doesn't seem to execute when i use

browser.windows.create({
        url: '../popup/index.html',

from my background script, because i get in my new window : Vite server did not start

Okay so the main reason was that I was trying to mount on #app but since contentScripts was already mounted on an ID app, it didn't worked.

Solution : change your id to something like popup.
Then

app.mount('#popup')

And in prepare.ts :

      .replace('<div id="popup"></div>', '<div id="popup">Loading</div>')