tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

console-panel.md (3374B)


Console Tool Architecture

The Console panel is responsible for rendering all logs coming from the current page.

Architecture

Internal architecture of the Console panel (the client side) is described on the following diagram.

flowchart TB
DevTools["DevTools<br/>[client/framework/devtools.js]"]
-- "openBrowserConsole() or<br/>toggleBrowserConsole()"
--> BrowserConsoleManager["BrowserConsoleManager<br/>[browser-console-manager.js]"]
-- "{_browserConsole}"
--> BrowserConsole["BrowserConsole<br/>[browser-console.js]"];
WebConsolePanel["WebConsolePanel<br/>[panel.js]"] -- "{hud}" --> WebConsole["WebConsole[webconsole.js]"]
-- "{ui}" --> WebConsoleUI["WebConsoleUI<br/>[webconsole-ui.js]"]
-- "{wrapper}" --> WebConsoleWrapper["WebConsoleWrapper<br/>[webconsole-wrapper.js]"]
-- "ReactDOM.render" --> App;
BrowserConsole -- extends --> WebConsole;

Components

The Console panel UI is built on top of React. It defines set of React components in components directory The React architecture is described on the following diagram.

flowchart TB
subgraph React Components
direction TB
App --> SideBar & NotificationBox & ConfirmDialog & FilterBar & ReverseSearchInput & ConsoleOutput & EditorToolbar & JSTerm
FilterBar --> FilterButton & ConsoleSettings
ConsoleOutput --> MessageContainer --> Message
Message --> MessageIndent & MessageIcon & CollapseButton & GripMessageBody & ConsoleTable & MessageRepeat
end
subgraph Reps
direction TB
ObjectInspector["ObjectInspector"] --> ObjectIspectorItem --> Rep["Rep<br/>[client/shared/components/reps/rep.mjs"] --> Rep
end
SideBar & ConsoleTable & GripMessageBody --> Reps
Message --> Frame["Frame<br/>[client/shared/components/Frame.js]"] & SmartTrace["SmartTrace<br/>[client/shared/components/SmartTrace.js]"] & TabboxPanel["TabboxPanel<br/>[client/netmonitor/src/components/TabboxPanel.js]"]
JSTerm -- editor --> Editor["Editor<br/>[client/shared/sourceeditor/editor.js]"]

There are several external components we use from the WebConsole:

Actions

The Console panel implements a set of actions divided into several groups.

State

The Console panel manages the app state via Redux.

There are following reducers defining the panel state: