Dev server for webextensions

Is it possible to develop webextensions on local dev server rather than debugging extension directly? I find debugging extensions as described in mdn guide frustrating experience.

For instance if I want log something in popup window into console I have to set devtools to be always on foreground and even then as soon as I try to click on the logged value the popup closes and value disappears. Other annoyance is that I can’t use hot reload tools like with browsersync or webpack-dev-server.

It’s easy enough to simply spin up http server and debug like I would with regular webapps until I start using things from webextension API such as cookies since browser object is unknown. Is there any way to get this working or do I have to stick debug extensions like shown in mdn debugging article?

Thanks for any help and sorry for bothering with newbie question.

You want to “Disable popup auto hide” at the top left of the Add-on debugger.

Other than that, reloading the extensions background page happens in a single click. AFAIK visible pages and content script are always loaded directly from their files. Automatically updating the directory they are loaded from is your task. What more do you expect?

1 Like