Skip to content

The network request logger

Raymond Hill edited this page Jun 8, 2015 · 45 revisions

uBlock comes with a network request logger, which gives the ability to inspect network requests, whether they were blocked or allowed, and which filter, if any, matched a network request.

To access the network request logger, click on the list icon of µBlock's popup UI:

Figure 1

The request logger will open in a new tab (which was moved to its own window below):

Figure 2

Take note that the network request logger in uBlock is a forward-looking logger: this means only future requests can be logged. In the spirit of efficiency, uBlock will log network requests for a tab if and only if there is a logger opened for that tab.


Components

Figure 3

The drop-down selector is to display log entries which are related to a specific tab. This will hide from view all log entries which are not related to the selected tab. By selecting All again, all log entries will be displayed again.

The big refresh button aside the tab selector is to refresh the content of the selector. When tabs are added or closed, you need to refresh explicitly the selector so that its content reflects the current tabs.

Note in the figure above the entry named "Behind the scene": selecting this entry allows you to see behind-the-scene network requests, i.e. those network requests which do not originate from a specific tab. More about this here.


Figure 4

This is to force a refresh of the tab which is currently being observed.


Figure 5

This is to remove all the logged entries.


Figure 6

You can filter entries in the logger using filter expressions. Log entries which do not match all filter expressions will be hidden from view. Syntax for a filter expression:

  • Enter foo to only show entries which have a string foo.
  • Enter |foo to only show entries which have a field starting with foo.
    • Tip: use |-- to show only entries which were blocked (-- may work for the most part, but there could be false positives).
  • Enter foo| to only show entries which have a field ending with foo.
  • Enter |foo| to only show entries which have exactly a field with foo.
  • Prefix any expression with ! to reverse the meaning of the expression.
    • !foo means display only entries which do not have the string foo in it.
    • !|-- means display only entries which were not blocked.
  • When more than one filter expression appear, a logical and between the expressions is implied.
  • You can or multiple expressions together:
    • css || image means display entries which match either css or image.
    • xhr || other |http: means display entries which match either xhr or other and have a field which starts with http:.
    • !css || image means display entries which do not match either css or images (equivalent to !css !image really).
    • Warning: With or'ed expressions, the not (!) operator can only apply to the resulting or'ed expression.
  • A special keyword can be used to filter behind-the-scene requests: bts, or |bts for a stricter filtering.

Examples:

  • !|-- facebook: show only non-blocked entries with the string facebook in it.
  • |xhr google: show only entries of type XMLHttpRequest with the work google in it.
  • !|image !|css: show only entries which are not of type image, neither css.

Figure 5

This is the maximum number of entries allowed in the request logger. When the maximum is reached, the oldest entries at the bottom will be removed to make place to newest entries at the top.

This is useful to be sure the request logger does not unduly consume a huge amount of memory if left open for long period of time. Usually, the most recent entries are the ones of interest. When this value is not set, there is a built-in limit of 25,000 entries.

One could leave the logger opened for long period of time with the "Behind the scene" selected to find out what the browser and other installed extensions are doing behind the scene.

Clone this wiki locally