Skip to content

后台网络请求

fang5566 edited this page Mar 31, 2015 · 20 revisions

动态过滤后台网络请求的功能适合打开了高级用户模式的用户使用。

什么是后台网络请求

后台 网络请求是指那些 uBlock 无法从浏览器任何已打开的标签页观察到的网络请求,这些请求来自_某处_,但 uBlock 缺少这方面的汇报信息,无法获知它们到底来自何方。

所有无法获知来源的网络请求都被归类为_后台_ 请求。通常其他过滤工具会忽略并自动将这些请求放行。

在 Chromium 浏览器里后台请求包括以下几种类型:

如何查看后台网络请求

从 uBlock 0.8.6.0 开始,你可以使用网络请求记录台查看所有后台网络请求,方法是点击下拉列表中的_"后台"_ 这项。

c
这里也可以看到各种各样扩展产生了后台请求

通常你需要长时间开着网络请求记录台以便抓取到所有后台网络请求。

查看后台请求的功能向所有用户开放,所以你不必事先开启_"高级用户 "_模式。

如何过滤后台网络请求

Important: The blocking of behind-the-scene network requests can cripple important functionality of your browser or installed extensions. If you decide to block some behind-the-scene network requests, you are entirely responsible for the consequences.

The ability to filter behind-the-scene network requests is only available when "advanced user" is enabled.

Also, the behind-the-scene virtual tab is whitelisted by default, i.e. no filtering will occur even after you enable "advanced user" mode.

To access the filtering settings for the behind-the-scene network requests is simple a matter of opening popup UI in the network request logger while the "Behind the scene" entry is selected:

Behind-the-scene popup
The popup UI will be filled with the settings/data of whatever tab is being currently inspected in the request logger.

The picture above shows what happen when you navigate through Github: Github makes use of navigator.sendBeacon() to send data to Google Analytics, which results in the firing of behind-the-scene requests in Chromium browser.

Important: Filter behind-the-scene requests at your own risk. I will close without further comment any reported issue which is a direct consequence of blocking behind-the-scene network requests.

Remember that if you block indiscriminately, you could cripple the ability of your browser to update parts of itself properly, ability to update extensions, ability of extensions to work properly, etc. This is why this is deemed an advanced user feature.

To turn off the filtering of behind-the-scene requests is just a matter of whitelisting the "Behind the scene" scope, or to turn off "advanced user" mode.

To whitelist the behind-the-scene scope: add behind-the-scene as a whitelist directive, in the Whitelist tab of uBlock's dashboard.

If there are only very specific behind-the-scene network requests you would like to filter, a good approach to minimize potential problems is to use dynamic filtering: set a local rule for the all cell to allow (green) (i.e. behind-the-scene * * allow). This will ensure nothing is blocked in the behind-the-scene scope, just as if uBlock is disabled for that scope. Then proceed to create block rules for the specific hostnames for which you want to block all network requests.

Clone this wiki locally