Privacybadger: Chrome warning: "This extension is slowing down Google Chrome..."

Created on 13 Jul 2015  路  15Comments  路  Source: EFForg/privacybadger

Chrome says PB is slowing it down! We should do what we can to get rid of this warning:
https://cl.ly/image/3A0y101A0x1i

Chrome bug performance

Most helpful comment

In version 2016.4.13 this issue has reappeared!

All 15 comments

Probably related to #319

After being disturbed by it, I think I found the culprit for this warning: it's not about blocking requests for too long, but rather calling chrome.webRequest.handlerBehaviorChanged() too often.

Check, https://code.google.com/p/chromium/issues/detail?id=136449#c3,

There are two ways of causing this message in theory:

  • by delaying network requests for too much time. This has been disabled in chrome/browser/extensions/api/web_request/web_request_time_tracker.cc and should not happen with an up to date Chrome.
  • by repeatedly flushing the in-memory caches, which happens by calling chrome.webRequest.handlerBehaviorChanged. The limit is 20 calls in 10 minutes, where two consecutive calls without any page loads are counted as only 1 call.

Here's the disabled code for ignoring excessive delays: https://code.google.com/p/chromium/codesearch#chromium/src/extensions/browser/api/web_request/web_request_time_tracker.cc&l=57

So only possible cause should be calling handlerBehaviorChanged too often (i.e. >20 calls in 10 mins) and rate-limiting calls should solve the problem.

I ran the following experiment to make sure:
_A:_

  • Disable all calls to handlerBehaviorChanged and artificially slow down blocking handler onBeforeRequest (code)
  • Open 15 top news sites in new tabs, then reload all the tabs.
  • Result: Even PB eats all the CPU, pages load extremely slow and you see "Waiting for extension PB" all the time, I did not get a "This extension is slowing down Chromium..." warning.

_B:_

  • Make calls to chrome.webRequest.handlerBehaviorChanged() too often, e.g. on every request. Remove code that artificially slows down PB (code)
  • Open 15 top news sites in new tabs, then reload all the tabs.
  • Result: Pages load without any significant delay. But you get "This extension is slowing down Chromium..." warning after a few minutes.

I repeated both A & B with Google Chrome and got the same result.

what is the result of rate limiting handlerBehaviorChanged? Does that have an effect on the operation of Privacy Badger?
Do you think you'd be able to make a Pull Request with this change? If so it could go out in PB v1.1

what is the result of rate limiting handlerBehaviorChanged? Does that have an effect on the operation of Privacy Badger?

I think the effect would be minimal if the 20 call per 10 mins limit is used in a smart way.

handlerBehaviorChanged flushes Chrome's in-memory cache. If Chrome has a resource in this cache which PB has just decided to block, it won't be really blocked until the tab is closed or handlerBehaviorChanged is called.

"Requests that are answered from the in-memory cache are invisible to the web request API.

webRequest API docs - Caching.

Do you think you'd be able to make a Pull Request with this change? If so it could go out in PB v1.1

Unfortunately, I won't be having time for this, otherwise I'd love to. Good luck!

screenshot 2015-08-07 at 12 32 25 am

In addition to the slowing down Chrome alert, I'm also getting various errors such as this one as seen below.

2015-08-11_15-23-04

Do you think you'd be able to make a Pull Request with this change? If so it could go out in PB v1.1

Here's a pull request. Based on adblockpluschome code and inspired by all the complaints.

Thanks Gunes! This pull request looks great, I have merged it and will release in the next couple of days.

Cool. I"m seeing this issue too. I'll look forward to the fix. I've definitely had issues w/ chrome slowing down recently and have gotten the same warning from chrome that dieseltravis posted.

This should be fixed by the newest version 2015.8.14, please update your addons and try again.

Okay, cool. Mine still shows 2015.8.5.1, so I probably just need to wait a bit longer for the update to become available to me. I'll check back.

I'm still only seeing the 8.5.1 version in the chrome store. I tried uninstalling and re-installing the extension. FWIW.

We are still waiting for chrome to review our extension. Hopefully soon...

In version 2016.4.13 this issue has reappeared!

Yup, still doing it. Constantly seeing it as 99.9% CPU usage on Chrome's task manager, it's not usable right now without constantly ending the process.

Was this page helpful?
0 / 5 - 0 ratings