Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically reload extension in Firefox as you edit code #138

Closed
kumar303 opened this issue Mar 14, 2016 · 2 comments
Closed

Automatically reload extension in Firefox as you edit code #138

kumar303 opened this issue Mar 14, 2016 · 2 comments

Comments

@kumar303
Copy link
Contributor

When editing web extension source code, reload the extension in Firefox so you can test it as you save your source files. There might be a couple ways to do this.

Firstly, the platform supports a special symlink file: If you put a text file in profile/extensions whose name is the addon id and the content is the absolute path to your addon source, you can reload it.

To reload it, you just need to disable it, flush the cache, and re-enable it (see flushJarCache() and flushStartupCache()). We will add a button for this but ideally web-ext could use the debugging API to send a message to Firefox to reload when necessary.

When reloaded, the add-on will see the shutdown and startup methods called, it won't see the uninstall/install called, but you probably don't want that for reload anyway

This reload trick won't work for XPI paths, only for directory paths.

@kumar303
Copy link
Contributor Author

There are some features in about:debugging that activate hot reloading for files like stylesheets (see bug 1257525). When running web-ext from the command line, we'll want to trigger this same behavior. We may need to do it like:

  • patch about:debugging to make remote actor calls instead of calling AddonManager APIs directly
  • mimic the same remote actor calls in web-ext

@kumar303
Copy link
Contributor Author

All major bugs here are fixed! There are a few open bugs but they are for less important edge cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant