isaurssaurav / hot-reload-extension-vite-plugin

Simple vite plugin to reload chrome extension on file change.
MIT License
21 stars 4 forks source link

How to keep chrome.sidePanel open during hot-reload #10

Open driuqzy opened 2 months ago

driuqzy commented 2 months ago

My extension is primarily a chrome.sidePanel, and hot reload causes the side panel to close, requiring me to re-open it after each hot reload.

Any way to keep it open?

isaurssaurav commented 2 months ago

@driuqzy
This could be really nice addition to this plugin. I also did face small hindrance when i was working with the pop-up too.

Maybe I will add the config param keepSidePanelOpen

hotReloadExtension({
      log: true,
      backgroundPath: 'path/to/background',
      keepSidePanelOpen: true,
      keepSidePopupOpen: true
})

OR

keep the state of sidePanel in memory.

I will work on it.

isaurssaurav commented 2 months ago

I looked into it and it is not possible to open sidepanel programmatically.

I would suggest you have shortcut command to open sidepanel for easier development. Thats, the only thing i can refer with this plugin at the moment.

But, I am still open to looking into it further.