gecko-dev/devtools/client/webconsole
2019-01-30 03:25:17 +00:00
..
actions Bug 1521170 - Add a rule that prevents calling some Array and String accessor methods without using the return value. r=Standard8,Gijs 2019-01-23 17:03:32 +00:00
components Bug 1521049 - Broken context menu on JSTerm icon; r=nchevobbe 2019-01-29 14:05:35 +00:00
configs
enhancers Bug 1486741 - Enable ESLint rule comma-dangle for all of mozilla-central (automatic fixes). r=mossop 2018-10-19 12:55:39 +00:00
middleware Bug 1486741 - Enable ESLint rule comma-dangle for all of mozilla-central (automatic fixes). r=mossop 2018-10-19 12:55:39 +00:00
reducers Bug 1489491 - Populate reverse search with input text selection; r=bgrins. 2019-01-18 13:20:44 +00:00
selectors Bug 1462394 - Handle autocompletion data fetching and caching in Redux; r=Honza. 2018-11-12 16:07:37 +00:00
test Bug 1522921 - Set the devtools chrome debugging prefs to true by default in mochitests and wpt r=ahal,miker 2019-01-30 03:25:17 +00:00
utils Bug 1486870 - Fix copy/pasting stacktraces in console; r=bgrins. 2019-01-25 17:16:10 +00:00
.babelrc
browser-console.js Bug 1486741 - Enable ESLint rule comma-dangle for all of mozilla-central (automatic fixes). r=mossop 2018-10-19 12:55:39 +00:00
constants.js Bug 1513244 - Close autocomplete navigation on page navigation; r=Honza. 2018-12-13 17:38:46 +00:00
hudservice.js Bug 1506549 - Return target fronts out of RootFront.getProcess and getMainProcess. r=yulia 2018-11-15 10:22:49 +00:00
index.html Bug 1390768 - Use new SmartTrace component in webconsole; r=Honza. 2018-11-12 15:42:40 +00:00
main.js Bug 1514594: Part 3 - Change ChromeUtils.import API. 2019-01-17 10:18:31 -08:00
moz.build Bug 1462399 - remove GCLI commands; r=ochameau 2018-09-03 17:24:32 +00:00
panel.js Bug 1503628 - Remove Target.isRemote. r=yulia 2018-11-08 10:08:59 +00:00
README.md Bug 1486446 - Remove Console Launchpad support; r=bgrins. 2018-08-27 16:31:58 +00:00
store.js Bug 1513244 - Extract fetchAutocompleteProperties from JsTerm into a Redux action; r=Honza. 2018-12-13 17:38:06 +00:00
types.js Bug 1486741 - Enable ESLint rule comma-dangle for all of mozilla-central (automatic fixes). r=mossop 2018-10-19 12:55:39 +00:00
utils.js Bug 1486741 - Enable ESLint rule comma-dangle for all of mozilla-central (automatic fixes). r=mossop 2018-10-19 12:55:39 +00:00
webconsole-connection-proxy.js Bug 1518777 - ensure that netmonitor and console tests wait for initialization and open requests tofinish before shutting down; r=nchevobbe 2019-01-24 11:47:39 +00:00
webconsole-frame.js Bug 1518777 - ensure that netmonitor and console tests wait for initialization and open requests tofinish before shutting down; r=nchevobbe 2019-01-24 11:47:39 +00:00
webconsole-l10n.js Bug 1454696 - Run eslint --fix for prefer-const;r=yulia 2018-06-01 12:36:09 +02:00
webconsole-output-wrapper.js Bug 1486870 - Fix copy/pasting stacktraces in console; r=bgrins. 2019-01-25 17:16:10 +00:00
webconsole.js Bug 1506118 - Use chromeUtilsWindow to start the parser worker; r=Honza. 2018-11-19 16:33:22 +00:00

WebConsole

The WebConsole (webconsole) shows you all the console API calls made by scripts and alerts you when javascript errors are thrown by a script. It can also display network logs, and you can evaluate expressions using the console input, a.k.a. JsTerm. You can read more about it on MDN to learn all the features and how to use the tool.

Run WebConsole

If you want to build the WebConsole inside of the DevTools toolbox (Firefox Devtools Panels), follow the simple Firefox build documentation. Start your compiled firefox and open the Firefox developer tool, you can then see the WebConsole tab.

Code Structure

Top level files are used to launch the WebConsole inside of the DevTools toolbox. The main files used to run the WebConsole are:

  • main.js called by devtools toolbox to launch the WebConsole panel.
  • index.html panel UI and launch scripts.

UI

The WebConsole UI is built using React components (in components/).

The React application is rendered from webconsole-output-wrapper.js. It contains 4 top components:

  • ConsoleOutput (in ConsoleOutput.js) is the component where messages are rendered.
  • FilterBar (in FilterBar.js) is the component for the filter bars (filter input and toggle buttons).
  • SideBar (in SideBar.js) is the component that render the sidebar where objects can be placed in.
  • JsTerm (in JsTerm.js) is the component that render the console input.

We prefer stateless component (defined by function) instead of stateful component (defined by class) unless the component has to maintain its internal state.

State

Besides the UI, the WebConsole manages the app state via [Redux]. The following locations define the app state:

  • src/constants.js constants used across the tool including action and event names.
  • src/actions/ for all actions that change the state.
  • src/reducers/ for all reducers that change the state.
  • src/selectors/ functions that return a formatted version of parts of the app state.

The redux state is a plain javascript object with the following properties:

{
  // State of the filter input and toggle buttons
  filters,
  // State of the input history
  history,
  // Console messages data and state (hidden, expanded, groups, …)
  messages,
  // State of notifications displayed on the output (e.g. self-XSS warning message)
  notifications,
  // Preferences (persist message, message limit, …)
  prefs,
  // Interface state (filter bar visible, sidebar visible, …)
  ui,
}

Tests

See test/README.md