question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: JS API for web-ext

See original GitHub issue

JS API would make it possible to use web-ext in build scripts (like gulpfile.js) without calls to system shell.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
futpibcommented, Mar 9, 2017

I’d say providing a separate JS API is a better option, so that you don’t “freeze” CLI implementation by telling users they can expect that it will be stable.

2reactions
kumar303commented, Dec 17, 2016

Well, actually, this should be enough. You can do a build like this:

> const main = require('web-ext/dist/web-ext').main;
> main(['build'], {runOptions: {shouldExitProgram: false}})
      .catch(error => console.error('CAUGHT', error));
Usage:  [options] command

Option values can also be set by declaring an environment variable prefixed
with $WEB_EXT_. For example: $WEB_EXT_SOURCE_DIR=/path is the same as
--source-dir=/path.

To view specific help for any given command, add the command name.
Example:  --help run.


Commands:
  build  Create a web extension package from source
  sign   Sign the web extension so it can be installed in Firefox
  run    Run the web extension
  lint   Validate the web extension source

Options:
  --version            Show version number                             [boolean]
  --source-dir, -s     Web extension source directory.
              [string] [required] [default: "/Users/kumar/tmp/web-ext-api-test"]
  --artifacts-dir, -a  Directory where artifacts will be saved.
                                                   [string] [required] [default:
                          "/Users/kumar/tmp/web-ext-api-test/web-ext-artifacts"]
  --verbose, -v        Show verbose output                  [boolean] [required]
  -h, --help           Show help                                       [boolean]

Not enough non-option arguments: got 0, need at least 1
Promise {
  _c: [],
  _a: undefined,
  _s: 0,
  _d: false,
  _v: undefined,
  _h: 0,
  _n: false }
> CAUGHT Error: Not enough non-option arguments: got 0, need at least 1
    at Object.self.fail (/Users/kumar/tmp/web-ext-api-test/node_modules/yargs/lib/usage.js:53:20)
    at Object.self.nonOptionCount (/Users/kumar/tmp/web-ext-api-test/node_modules/yargs/lib/validation.js:21:15)
    at parseArgs (/Users/kumar/tmp/web-ext-api-test/node_modules/yargs/yargs.js:945:20)
    at Object.Yargs.Object.defineProperty.get [as argv] (/Users/kumar/tmp/web-ext-api-test/node_modules/yargs/yargs.js:812:16)
    at Program._callee$ (/Users/kumar/tmp/web-ext-api-test/node_modules/web-ext/dist/webpack:/src/program.js:9:7845)
    at tryCatch (/Users/kumar/tmp/web-ext-api-test/node_modules/regenerator-runtime/runtime.js:62:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/Users/kumar/tmp/web-ext-api-test/node_modules/regenerator-runtime/runtime.js:336:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Users/kumar/tmp/web-ext-api-test/node_modules/regenerator-runtime/runtime.js:95:21)
    at step (/Users/kumar/tmp/web-ext-api-test/node_modules/web-ext/dist/webpack:/~/babel-runtime/helpers/asyncToGenerator.js:17:1)
    at /Users/kumar/tmp/web-ext-api-test/node_modules/web-ext/dist/webpack:/~/babel-runtime/helpers/asyncToGenerator.js:35:1

>
Read more comments on GitHub >

github_iconTop Results From Across the Web

REST API Basics | Webex for Developers
With pagination, the Webex API returns a specific number of items at a time; allowing your app to request more items as needed....
Read more >
JavaScript APIs - Mozilla - MDN Web Docs
Use this API to register user scripts, third-party scripts designed to manipulate webpages or provide new features. Registering a user script ...
Read more >
Getting started with web-ext | Firefox Extension Workshop
web-ext is a node-based application that you install with the nodejs/npm tool. Install web-ext using the following command:
Read more >
webex/webex-js-sdk: JavaScript SDK for Webex - GitHub
This is a monorepo containing all officially maintained Cisco Webex JS SDK modules in the same repo. webex is a collection of node...
Read more >
Webex URL API - Post Request Fails - Cisco Community
When I send a post request to enroll an attendee for a web conference, the attendee is not enrolled. The response is an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found