gecko-dev/devtools/client/netmonitor
Arun Kumar Mohan d9dcefe8ce Bug 1554883 - Refactor requests reducer to remove disabled complexity eslint rule. r=pbro
Differential Revision: https://phabricator.services.mozilla.com/D39472

--HG--
extra : moz-landing-system : lando
2019-07-27 00:47:00 +00:00
..
src Bug 1554883 - Refactor requests reducer to remove disabled complexity eslint rule. r=pbro 2019-07-27 00:47:00 +00:00
test Bug 1479782 - disabled browser_net_frame.js on all platforms a=test-only 2019-07-20 11:18:44 +03:00
.eslintrc.js Bug 1558517 - Pre 3.0: Remove conflicting eslint rules, and turn on "curly: all" everywhere, r=standard8 2019-06-28 17:14:01 +02:00
README.md Bug 1567084 - Remove files related to running netmonitor with launchpad/chrome r=Honza 2019-07-18 10:33:57 +00:00
index.html Bug 1471152 - Package all panel scripts under resource://devtools/ instead of chrome://devtools/. r=jdescottes 2018-06-25 12:59:22 -07:00
initializer.js Bug 1561435 - Format devtools/client/, a=automatic-formatting 2019-07-05 11:24:38 +02:00
moz.build Bug 1471152 - Package all panel scripts under resource://devtools/ instead of chrome://devtools/. r=jdescottes 2018-06-25 12:59:22 -07:00
panel.js Bug 1566435 - Make netmonitor destroy codepath synchronous. r=Honza 2019-07-17 16:57:53 +00:00

README.md

Network Monitor

The Network Monitor (netmonitor) shows you all the network requests Firefox makes (for example, when a page is loaded or when an XMLHttpRequest is performed) , how long each request takes, and details of each request. You can edit the method, query, header and resend the request as well. Read MDN to learn all the features and how to use the tool.

Prerequisite

If you want to build the Network Monitor inside of the DevTools toolbox (Firefox Devtools Panels), follow the simple Firefox build document in MDN. Start your compiled firefox and open the Firefox developer tool, you can see the Network Monitor inside.

Run inside of the DevTools toolbox

Files used to run the Network Monitor inside of the DevTools toolbox.

  • panel.js called by devtools toolbox to launch the Network Monitor panel.
  • index.html panel UI and launch scripts.
  • src/connector/ wrap function call for Browser specific API. Current support Firefox and Chrome(experimental).

UI

The Network Monitor UI is built using React components (in src/components/).

  • MonitorPanel in MonitorPanel.js is the root element.
  • Three major container components are
    • Toolbar Panel related functions.
    • RequestList Show each request information.
    • NetworkDetailsPanel Show detailed information per request.
    • StatusBar Show statistics while loading.
  • src/assets Styles that affect the Network Monitor panel.

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

State

Besides the UI, the Network Monitor 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.

We use reselect library to perform state calculations efficiently.