gecko-dev/devtools/client/webconsole
Claudia c0e4f423b1 Bug 1430022 - [devtools] Adds an error message in the copy command on a cyclic object r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D120623
2021-07-29 05:36:13 +00:00
..
actions Bug 1708386 - [devtools] Add an evaluation result message when using the `copy` helper. r=nchevobbe 2021-07-13 13:05:00 +00:00
components Bug 1711463 - [devtools] Update EvaluationContextSelector items on DOCUMENT_EVENT resources. r=jdescottes. 2021-05-19 16:58:07 +00:00
enhancers
middleware
reducers
selectors
test Bug 1430022 - [devtools] Adds an error message in the copy command on a cyclic object r=nchevobbe 2021-07-29 05:36:13 +00:00
utils Bug 1430022 - [devtools] Adds an error message in the copy command on a cyclic object r=nchevobbe 2021-07-29 05:36:13 +00:00
README.md
browser-console-manager.js Bug 1699200 - [devtools] Create all commands via a CommandsFactory module. r=nchevobbe,jdescottes 2021-03-25 16:02:32 +00:00
browser-console.js Bug 1701790 - Migrate ResourceWatcher to become ResourceCommand. r=nchevobbe 2021-05-04 09:29:47 +00:00
constants.js
index.html
moz.build Bug 1712739 - [devtools] Add a `script` command with an `execute` method. r=jdescottes. 2021-06-02 13:15:06 +00:00
panel.js Bug 1702061 - [devtools] Remove isPanelReady flag and devtools-panel-ready from DevTools panel instances r=nchevobbe 2021-03-31 12:41:44 +00:00
service-container.js Bug 1721375 - [devtools] Remove WebConsoleFront getString method. r=bomsy. 2021-07-21 05:13:16 +00:00
store.js
types.js
utils.js
webconsole-connection-proxy.js Bug 1712591 - [devtools] Migrate from navigate to DOCUMENT_EVENT dom-complete in the web console. r=nchevobbe 2021-06-02 16:44:41 +00:00
webconsole-ui.js Bug 1721375 - [devtools] Remove WebConsoleFront getString method. r=bomsy. 2021-07-21 05:13:16 +00:00
webconsole-wrapper.js Bug 1712739 - [devtools] Add a `script` command with an `execute` method. r=jdescottes. 2021-06-02 13:15:06 +00:00
webconsole.js Bug 1712739 - [devtools] Add a `script` command with an `execute` method. r=jdescottes. 2021-06-02 13:15:06 +00:00

README.md

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-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