gecko-dev/devtools/client/webconsole
Nicolas Chevobbe bbf3b023c0 Bug 1692027 - [devtools] Fix browser_jsterm_screenshot_command_clipboard.js intermittent. r=bomsy
Differential Revision: https://phabricator.services.mozilla.com/D105025
2021-02-15 12:39:44 +00:00
..
actions Bug 1691934 - [devtools] Remove clearLogpointMessages and associated code. r=ochameau. 2021-02-10 14:49:47 +00:00
components Bug 1690221 - [devtools] Remove unused Connector.setPreferences method. r=bomsy 2021-02-04 09:06:41 +00:00
enhancers Bug 1691934 - [devtools] Remove clearLogpointMessages and associated code. r=ochameau. 2021-02-10 14:49:47 +00:00
middleware Bug 1654103: Standardize on Black for Python code in `mozilla-central`. 2020-10-26 18:34:53 +00:00
reducers Bug 1438979 - [devtools] Re-enable browser_webconsole_network_messages_expand.js. r=bomsy. 2021-01-27 09:37:23 +00:00
selectors Bug 1654103: Standardize on Black for Python code in `mozilla-central`. 2020-10-26 18:34:53 +00:00
test Bug 1692027 - [devtools] Fix browser_jsterm_screenshot_command_clipboard.js intermittent. r=bomsy 2021-02-15 12:39:44 +00:00
utils Bug 1691934 - [devtools] Remove clearLogpointMessages and associated code. r=ochameau. 2021-02-10 14:49:47 +00:00
.babelrc
README.md Bug 1628599 - Fixing all links pointing to docs.firefox-dev.tools r=Honza,remote-protocol-reviewers,perftest-reviewers,maja_zf,davehunt 2020-06-01 10:58:38 +00:00
browser-console-manager.js Bug 1474006 - [devtools] Enable screenshots for Browser Console and Browser Toolbox. r=jdescottes. 2021-02-05 09:25:05 +00:00
browser-console.js Bug 1642599 - [devtools] Enable all console messages server support everywhere. r=ochameau. 2021-02-11 06:08:34 +00:00
commands.js Bug 1616301 - Handle targets in toolbox store instead of threads. r=jlast. 2020-04-01 14:33:58 +00:00
constants.js Bug 1691934 - [devtools] Remove clearLogpointMessages and associated code. r=ochameau. 2021-02-10 14:49:47 +00:00
index.html Bug 1671163 - [devtools] Move object inspector out of reps folder. r=nchevobbe 2020-10-23 14:50:09 +00:00
moz.build Bug 1654103: Standardize on Black for Python code in `mozilla-central`. 2020-10-26 18:34:53 +00:00
panel.js
service-container.js Bug 1643180 - Part 2: Update the Frame component to always pass generated position to view source. r=jlast 2020-06-05 22:18:38 +00:00
store.js Bug 1686440 - [devtools] Fix webconsole network events and stacktrace tests r=ochameau,nchevobbe 2021-01-13 12:37:21 +00:00
types.js Bug 1691934 - [devtools] Remove clearLogpointMessages and associated code. r=ochameau. 2021-02-10 14:49:47 +00:00
utils.js
webconsole-connection-proxy.js Bug 1689297 - [devtools] Add cloned content process message resource. r=ochameau,devtools-backward-compat-reviewers. 2021-02-11 06:08:33 +00:00
webconsole-ui.js Bug 1642599 - [devtools] Enable all console messages server support everywhere. r=ochameau. 2021-02-11 06:08:34 +00:00
webconsole-wrapper.js Bug 1691934 - [devtools] Remove clearLogpointMessages and associated code. r=ochameau. 2021-02-10 14:49:47 +00:00
webconsole.js Bug 1658724 - Don't start the parser worker if it's not needed when evaluating an expression in the console. r=jdescottes. DONTBUILD 2020-08-17 13:22:51 +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