Use the Console panel to view logged messages and run JavaScript. Before you start debugging, please take some time to familiarize yourself with the Lynx JavaScript Runtime.
The Console can be opened as a panel or as a tab in the Drawer.
If you want to view the Console panel while using other panels, you can open the Console in the Drawer.
Please refer to Open the Console in the Drawer | Chrome DevTools.
The following links explain each setting:
Please refer to Open the Console Sidebar | Chrome DevTools.
The types of logs currently can be viewed include:
JavaScript logs. Including the main thread and the background thread.
[main-thread.js]
prefix.Some client logs.
Currently, client runtime errors and some other client logs are serialized as strings and displayed in the Console panel.
For JavaScript logs, the App.tsx:11
on the right side of the log represents where it logged. Clicking it will open the Sources panel and highlight the line of code that caused the message to get logged to the Console.
DevTool enables Group similar messages in console by default, which aggregates similar messages logged consecutively.
Open Console Settings and disable this option to expand the logs that were originally grouped.
Please refer to Filter by log level | Chrome DevTools.
When the sidebar is open, you cannot click the log level drop-down.
Please refer to Filter by text | Chrome DevTools.
Please refer to Filter by regular expression | Chrome DevTools.
Please refer to Filter messages by URL | Chrome DevTools.
By default, all logs are displayed within the context of the background thread. When Main thread debugging is enabled, an additional context of the main thread will be added.
As shown in the figure, Background:-1
represents the background thread, and Main
represents the main thread.
When you run JavaScript in the Console, it will execute only within the currently selected context.
Open Console Settings and enable Selected context only checkbox to display logs only from the currently selected context.
Please refer to Search for text in logs | Chrome DevTools.
The Console is a REPL, which stands for "Read, Evaluate, Print, and Loop." It reads the JavaScript you enter, evaluates your code, outputs the result of the expression, and then loops back to the first step.
You can enter expressions related to the current page in the Console, such as this
.
You can also enter expressions unrelated to the current page, such as 1+2
.
Press Enter to get the result, and the Console will output the result of the expression below the code.
Please refer to String copy options | Chrome DevTools.
For example, in this case, the results of copying are as follows:
Please refer to Re-run expressions from history | Chrome DevTools.
Please refer to Watch JavaScript values in real time with Live Expressions | Chrome DevTools.
Please refer to Disable Eager Evaluation | Chrome DevTools.
Please refer to Disable autocomplete from history | Chrome DevTools.
You can use any of the following workflows to clear the Console: