samrum / vite-plugin-web-extension

A vite plugin for generating cross browser platform, ES module based web extensions.
MIT License
325 stars 32 forks source link

How to override browser start page #43

Closed HZNU-Qiu closed 2 years ago

HZNU-Qiu commented 2 years ago

I'm novice and I wanna develop a chrome extension by Vue.My problem is: 'How to override my browser start page in this framework?' I hope to override the default tab page, so I write these in the manifest:

... 
chrome_url_overrides : {
    newtab: "src/entries/tabs/index.html"
  },
...

And I make a directory under the /src, which named tabs. There are 3 files(index.html, App.vue, main.js) in it. However, when I build the project, I found that the tab folder created before is not in the dist package. There are only popup, options, contentScript in the dist folder.

How to package tabs folder into the dist ? I'll appreicate that if anyone could give me a hand :)

samrum commented 2 years ago

chrome_url_overrides.newtab isn't handled by the plugin at the moment. Should be easy to add support for that, though.

As a workaround for now, you should be able to add the html file to web accessible resources and the library will process it.

HZNU-Qiu commented 2 years ago

chrome_url_overrides.newtab isn't handled by the plugin at the moment. Should be easy to add support for that, though.

As a workaround for now, you should be able to add the html file to web accessible resources and the library will process it.

Thank you very much for your suggestion, my problem has been solved successfully :)