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
feat: You can now use web-ext programatically, e.g. webExt.cmd.run()
#1028
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure why the logger is needed. should there be any doc for it?
I was thinking that the caller may want to have some control over the log output. The could also replace
Yeah, definitely. The way we do it is once the issue lands and web-ext gets deployed with the change, we document it on MDN. |
... although, hmm, maybe the README should have some docs since this usage is more developer focused. |
if there would be a way to silence/capture the logs through Dev oriented docs could be published at readthedocs, what do you think? |
I don't want to maintain and manage another service. I think we can try it in our current documentation and see how hard it is. |
|
||
export {main}; | ||
// This only exposes util/logger so far. | ||
// Do we need anything else? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kumar303 👍 Nice! This is pretty neat!
The change seems ok to me, but I'm wondering if we should make some tweak to the defaultReloadStrategy, mostly to make the caller of the API able to disable or customize the "interactive" behavior (e.g. reading from stdin when used as a library doesn't seem a great idea, it is probably something that the caller may want to easily disable and maybe manage with an API object which allow it to know when a change has been detected, trigger the addon reload and exit the runner).
What do you think?
Thanks @rpl , good idea about disabling input. Could you take another look? I added |
@kumar303 👍 looks great Let's file the following as followups:
|
It's currently returning |
Feature request for |
currently we are returning It seems to be what #1027 is aiming to, though, and so there is no need to file another issue for it. |
Fixes #683
This only supports minimal programmatic use. You can execute raw functions without any argument validation, like:
One would have to set up verbose logging manually:
You can also disable the use of standard input:
Here is an example of disabling manifest validation if you want to work with an add-on that's not a WebExtension: