Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

Nano adblocker causes CPU spike under certain conditions #348

Closed
liamengland1 opened this issue Jul 3, 2020 · 4 comments
Closed

Nano adblocker causes CPU spike under certain conditions #348

liamengland1 opened this issue Jul 3, 2020 · 4 comments
Labels
archived This thread was archived, open new issues for similar problems. bug fixed upstream

Comments

@liamengland1
Copy link

liamengland1 commented Jul 3, 2020

Describe the issue (Required)

Nano adblocker causes Chrome devtools to lag and eat CPU under certain conditions.

Screenshots (Required)

image

Screenshot of console (Required, press F12 to open the console)

It's empty

URLs where this issue occurs (Required if applicable)

http://example.com

Reproduction Steps (Optional if trivial)

  1. Add example.com##* to my filters
  2. Visit http://example.com
  3. Open devtools

Anything else you believe to be useful (Optional)

Nano Adblocker adds display: none!important as an inline style over and over on the html tag on any site where a filter of type example.com##* is applied.

Cannot reproduce CPU spike in uBo or Nano firefox.

Environment (Required)

  • Operating System and Version: Windows 10 1909
  • Browser and Version: Chrome 83.0.4103.116
  • Nano Adblocker Version: 1.0.0.149
  • Nano Defender Version (Optional if you are not using it):

Your filter lists (Required)

N/A

Your custom filters (Required if you have any)

N/A

Your other extensions (Required if you have any)

N/A

@jspenguin2017
Copy link
Member

Hum... Looks like a bug with the pseudo UserCSS engine.

@gorhill are you still maintaining the pseudo UserCSS engine?

@gorhill
Copy link

gorhill commented Jul 3, 2020

Frankly I think it's probably best to just drop pseudo user styles and fall back on using insertCSS() without the cssOrigin parameter, it's not worth maintaining a not trivial code base which is meant for pre-Chromium 66. The only consequence is that whoever uses old versions of Chromium may not have their cosmetic filters being enforced.

gorhill added a commit to gorhill/uBlock that referenced this issue Jul 3, 2020
@gorhill
Copy link

gorhill commented Jul 3, 2020

Trivially fixed with gorhill@a5ba668.

Though I will still drop support of the pseudo version in next release.

@jspenguin2017
Copy link
Member

gorhill added a commit to gorhill/uBlock that referenced this issue Jul 22, 2020
The pseudo user styles code served only browsers based
on Chromium 65 and earlier -- Chromium 66 supports
native user styles and was first released more than two
years ago.

In Chromium-based browsers, the pseudo user styles code
is being unconditionally injected in every page/frame
just in case the browser is version 65 or earlier.

Removing pseudo user styles reduce uBO's main content
script in Chromium-based browsers by more than 20K.

Related thread:
- NanoAdblocker#348 (comment)
@github-actions github-actions bot added the archived This thread was archived, open new issues for similar problems. label Aug 21, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Aug 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived This thread was archived, open new issues for similar problems. bug fixed upstream
Projects
None yet
Development

No branches or pull requests

3 participants