uBlockOrigin / uAssets

Resources for uBlock Origin, uMatrix: static filter lists, ready-to-use rulesets, etc.
GNU General Public License v3.0
4.03k stars 758 forks source link

blocking resources may cause high cpu usage on some site #9128

Closed ghost closed 3 years ago

ghost commented 3 years ago

Prerequisites

Description

Basically you should find some way to prevent high cpu usage by scripts of site when we block some elements like images. I think redirection would work perfectly. I noticed few more websites exhibiting same behavior, kind of like punishes us for blocking resources or tries to load resource until it succeeds.

A specific URL where the issue occurs

https://forum.klix.ba/

Steps to Reproduce

  1. go to url
  2. block all images using this filter: forum.klix.ba/$image
  3. refresh page

Expected behavior:

should just block all images

Actual behavior:

Blocks all images but counter shows increasing count >1k and in network monitor we can observe same image trying to reload. You can verify this by watching counter or by watching network monitor of web browser or log of extension. This images reloads billions times: https://forum.klix.ba/styles/prosilver_se/theme/images/no_avatar.gif This script is guilty: https://forum.klix.ba/ext/vse/topicpreview/styles/all/template/topicpreview.js?assets_version=254 When I block that script too using filter ||forum.klix.ba/*topicpreview.js$script, issue is resolved. Result of network monitor: Screenshot

Your environment

uBlock-user commented 3 years ago

Issue is very intermittent, can't reproduce consistently, seems the site keeps polling the blocked images when it happens.

uBlock-user commented 3 years ago

I think redirection would work perfectly.

Add *$image,redirect-rule=1x1.gif,domain=forum.klix.ba to my filters

gorhill commented 3 years ago

Filter issues are to be reported at uAssets, as requested in template.