V4 - create devtools_page example with vite #227
-
Hi import Browser from "webextension-polyfill";
import devtoolsPanelPage from "./devtools-panel-page.html";
async function createPanel() {
const url = Browser.runtime.getURL(devtoolsPanelPage as string);
const { onShown } = await Browser.devtools.panels.create(
"My devtools title",
"",
url
);
onShown.addListener(() => {
//
});
} But this is not working for me. Following #187 - I want to bundle and create another page for the devtools panel - but I cannot import HTML (the plugin does not resolve it) I would like to see an example just to make the devtools page render something with react or add a description in the docs/readme. Thank you :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
@nirtamir2 Awesome PR archeology! HTML imports interfered with Vite's HTML pipeline, so I removed them in #200. I've redacted that part of #187. Thanks for bringing it to my attention! Sorry for the inconvenience. Vite supports multiple HTML pages; that's what I would try: Multi-Page App | Vite I'll release an article for creating a devtools extension soon! Subscribe to this post for a link here when it's out. |
Beta Was this translation helpful? Give feedback.
@nirtamir2 Awesome PR archeology! HTML imports interfered with Vite's HTML pipeline, so I removed them in #200. I've redacted that part of #187. Thanks for bringing it to my attention! Sorry for the inconvenience.
Vite supports multiple HTML pages; that's what I would try: Multi-Page App | Vite
I'll release an article for creating a devtools extension soon! Subscribe to this post for a link here when it's out.