Opened on 11/21/2017 at 04:11:03 PM

Closed on 08/29/2019 at 05:43:18 PM

#6067 closed defect (rejected)

[webextension] Firefox displays "Adblock Plus is causing Firefox to slow down." warning

Reported by: lsdornheim Assignee: mjethani
Priority: Unknown Milestone:
Module: Platform Keywords: closed-in-favor-of-gitlab
Cc: greiner, kzar, sebastian, Ross, mapx, oleksandr, mjethani Blocked By:
Blocking: Platform: Firefox
Ready: no Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description (last modified by kzar)

Environment

Mac OS 10.12.5 (16F2073), Firefox 57.0, Adblock Plus 3.0.1

Subscriptions: Acceptable Ads, EasyList, Adblock Warning Removal List
All up to date except Adblock Warning Removal List which is giving a "Failed, download failure" error.

One whitelisted domain (sueddeutsche.de), no custom filters.

How to reproduce

  1. Open a new tab.
  2. The warning bar is shown (see screenshot).
  3. Click "wait", notice the warning goes away but then reappears after approximately 10 seconds.
  4. Browse to https://www.facebook.com/ in the tab, notice the warning remains.
  5. Browse to https://www.ebay.de/ in the tab, notice the warning goes after the page had loaded.

Observed behaviour

The warning is shown (see screenshot).

Expected behaviour

No warning from my favorite browser about my favorite extension!

Notes

  • If I have one tab with that notification, the notification automatically is in every new (empty) tab I open until another website is loaded.
  • For some (heavier?) websites the warning reappears after the page had loaded. Facebook, Discourse and https://www.ebay-kleinanzeigen.de also triggers the notification, but ebay.de doesn't.

Attachments (3)

Screen Shot 2017-11-21 at 16.34.22.png (250.2 KB) - added by kzar on 11/21/2017 at 05:38:16 PM.
Screen Shot 2017-11-21 at 20.41.27.png (239.3 KB) - added by lsdornheim on 11/21/2017 at 07:45:55 PM.
Firefox warning on google search
Screen Shot 2017-11-23 at 1.47.35 PM.png (1.2 MB) - added by mjethani on 11/23/2017 at 12:52:29 PM.
Developer Tools performance recording

Download all attachments as: .zip

Change History (34)

comment:1 Changed on 11/21/2017 at 04:54:33 PM by greiner

  • Cc greiner added

comment:2 follow-up: Changed on 11/21/2017 at 05:37:09 PM by kzar

  • Cc kzar trev sebastian added
  • Component changed from Unknown to Platform
  • Description modified (diff)
  • Summary changed from [webextensions] to [webextension] Firefox displays "Adblock Plus is causing Firefox to slow down." warning

Thanks for the bug report, I have a few questions.

Please could you confirm the Adblock Plus version by browsing to about:addons and then clicking the "More" button by Adblock Plus?

Apart from Acceptable Adverts could you confirm which filter lists you're subscribed to? (Click ABP icon, click Options, click Advanced and then scroll down to FILTER LISTS section.)

Please could you try clicking the UPDATE ALL FILTER LISTS button, and then once they all finished updating seeing if the warning still is displayed?

Please could you also confirm you don't have any custom filters (they are listed below the FILTER LISTS section).

Do you hit Enter before the warning is displayed, or does it display as you're still typing the address?

Do you have much other stuff running? What spec is your computer?

comment:3 Changed on 11/21/2017 at 05:37:33 PM by kzar

  • Cc Ross added

Changed on 11/21/2017 at 05:38:16 PM by kzar

Changed on 11/21/2017 at 07:45:55 PM by lsdornheim

Firefox warning on google search

comment:4 in reply to: ↑ 2 Changed on 11/21/2017 at 08:02:07 PM by lsdornheim

Replying to kzar:

Thanks for the bug report, I have a few questions.

Please could you confirm the Adblock Plus version by browsing to about:addons and then clicking the "More" button by Adblock Plus?

Version number 3.0.1

Apart from Acceptable Adverts could you confirm which filter lists you're subscribed to? (Click ABP icon, click Options, click Advanced and then scroll down to FILTER LISTS section.)

Besides Easylist only the "Adblock Warning Removal List".

Please could you try clicking the UPDATE ALL FILTER LISTS button, and then once they all finished updating seeing if the warning still is displayed?

Done, nothing changed. Will restart FF / computer next.

Please could you also confirm you don't have any custom filters (they are listed below the FILTER LISTS section).

Nope, none.

Do you hit Enter before the warning is displayed, or does it display as you're still typing the address?

In a new tab, it is there before I even start typing. It disappears when a new site is loaded. Unless the site triggers the notification again.

Do you have much other stuff running? What spec is your computer?

Not much, and nothing intense. Regular office stuff (Thunderbird, Skype, Spotify...) but I do usually have >10 tabs open. My MacBook is not the most powerful (1,4 GHz Intel Core i7, 16 GB Memory) but I think that is rather average for "normal users".

comment:5 Changed on 11/21/2017 at 08:02:55 PM by lsdornheim

I just realized it happens at google. At every single search. That's quite bad...

comment:6 follow-up: Changed on 11/21/2017 at 08:42:19 PM by mapx

If I understand correctly your lists (easylist especially) cannot be downloaded ? you get failures ?

What if you unselect easylist (and every other list) and subscribe easylist from here:
http://axistrivia.altervista.org/easy.html

Do you still get that unresponsive scripts / stuff ?

Last edited on 11/21/2017 at 08:43:41 PM by mapx

comment:7 Changed on 11/21/2017 at 08:47:58 PM by mapx

  • Cc mapx added

comment:8 Changed on 11/22/2017 at 07:52:27 AM by mapx

nevermind. I can reproduce as well.

go to https://9anime.is/watch/one-piece.ov8/4vo0xo

  • open devtools (press F12) and go to into ABP panel (I was debugging a filter issue, so probably is not the unique way to trigger the wrong behaviour)
  • refresh the page => after a while the message (scripts unresponsive ..) goes out

in the browser console I can see a lot of "TypeError: can't access dead object"

Error: ext is not defined  undefined
Firefox can’t establish a connection to the server at wss://realtime.services.disqus.com/ws/2/thread/5281961594?.  comments:164:43
The connection to wss://realtime.services.disqus.com/ws/2/thread/5281961594? was interrupted while the page was loading.  comments:164:43
TypeError: can't access dead object tab.js:1647:1
TelemetryStopwatch: key "FX_SCHEDULE_PRESSURE_IDLE_SAMPLE_MS" was already initialized  TelemetryStopwatch.jsm:356
Loading failed for the <script> with source “https://9anime.is/assets/min/frontend/all.js?5a1518d4”.  one-piece.ov8:11
Invalid chrome URI: /TypeError: can't access dead object tab.js:1647:1
Loading failed for the <script> with source “https://jsc.mgid.com/9/a/9anime.to.94438.js?t=11710228”.  one-piece.ov8:1
Loading failed for the <script> with source “https://trends.revcontent.com/serve.js.php?w=83562&t=rc_334&c=1511336715533&width=1288&referer=”.  one-piece.ov8:1
Loading failed for the <script> with source “https://st.bebi.com/bebi_v3.js”.  one-piece.ov8:47
Loading failed for the <script> with source “https://trends.revcontent.com/serve.js.php?w=65320&t=rc_813&c=1511336715690&width=1288&referer=”.  one-piece.ov8:1
Loading failed for the <script> with source “https://st.bebi.com/bebi_v3.js”.  4vo0xo:80
Loading failed for the <script> with source “https://www.google-analytics.com/analytics.js”.  4vo0xo:1
Loading failed for the <script> with source “https://st.bebi.com/bebi_v3.js”.  4vo0xo:128
Loading failed for the <script> with source “https://st.bebi.com/bebi_v3.js”.  4vo0xo:132
Loading failed for the <script> with source “https://www.onclickprediction.com/a/display.php?r=1834015”.  aplayer.html:16
TypeError: can't access dead object tab.js:1647:1
TypeError: can't access dead object tab.js:1647:1
Error: Script terminated by timeout at:
checkNodes@moz-extension://d2871d2e-2485-4e0d-8a2f-1021f8ebbaa9/include.preload.js:402:29
trace@moz-extension://d2871d2e-2485-4e0d-8a2f-1021f8ebbaa9/include.preload.js:498:5

comment:9 in reply to: ↑ 6 Changed on 11/22/2017 at 08:25:54 AM by lsdornheim

Replying to mapx:

If I understand correctly your lists (easylist especially) cannot be downloaded ? you get failures ?

What if you unselect easylist (and every other list) and subscribe easylist from here:
http://axistrivia.altervista.org/easy.html

Do you still get that unresponsive scripts / stuff ?

No, easylist was fine. It was the Anti-Adblock-Warnings-List that originally wasn't properly downloaded but that didnt change anything.

comment:10 Changed on 11/22/2017 at 08:32:31 AM by lsdornheim

I have restarted Firefox and even with roughly 20 tabs, so far the only warning I got was "a page is slowing down FF".

I got the APB warning on several sessions previously, will keep an eye open when it starts happening again!

comment:11 Changed on 11/22/2017 at 09:59:34 AM by kzar

  • Description modified (diff)

Thanks for all those answers, I've updated the issue. So did the Anti Adblock Warning List download in the end, or is that still failing?

comment:12 Changed on 11/22/2017 at 10:13:23 AM by oleksandr

  • Cc oleksandr added

comment:13 Changed on 11/22/2017 at 10:38:54 AM by mjethani

  • Cc mjethani added

comment:14 Changed on 11/22/2017 at 12:00:59 PM by mjethani

I haven't been able to reproduce this on Firefox 57, nor on Firefox Nightly (58.0a1), with adblockpluschrome master.

From the error log it looks like it's getting stuck on iterating over the result of Element.querySelectorAll, which is a non-live NodeList. We're also using the same label for the for...of loop as one of the variable names. It could just be one of those bugs in Firefox (I'm just speculating).

@mapx are you able to reproduce this consistently?

comment:15 Changed on 11/22/2017 at 12:27:33 PM by mapx

I tested again (weaker system, windows 7, FF 57, easylist, easyprivacy, easy germany, some other personal filters)

The same test link above.

All the test session keeping opened devtools, ABP panel.

Refresh page, no problem, switch to another episode, all fine.

Switching episodes I get anti adblocking msg, so I add @@||9anime.is^$generichide and from this moment I can reproduce again the error (FF warning) even if I disable the generichide filter. This (probably) could indicate some missing initialization / memory leak too.

comment:16 Changed on 11/22/2017 at 12:39:19 PM by mapx

After that first moment going to this page
https://en.pons.com/translate?q=test&l=deen&in=&lf=de

I got repeatedly the same warning / error. A heavy site like cnn ... no problems.
However, I reopened the browser and rechecked pons site => all fine now, no errors / warnings.

So, the assumption of some missing initialization / memory leak is stronger now.

Probably you should test not only in linux.

Last edited on 11/22/2017 at 12:54:24 PM by mapx

comment:17 Changed on 11/23/2017 at 12:50:30 PM by mjethani

I am able to reproduce this now on Firefox 57.0.

I have exactly Laura's setup, including the one whitelisted domain. I'm getting the warning on the 9anime.is URL shared by @mapx. In my case the warning appears briefly and then goes away only to return for another brief period.

I did a 24-second performance recording in Developer Tools and couldn't tell what was obviously causing this to happen. It looks like the extension spends too much time in functions like getSelectorsForDomain, isActiveForDomain, matchesAny, and so on. It's not clear if this is the problem, as the time spent in these functions is still only a few milliseconds.

This will have to be investigated further.

Changed on 11/23/2017 at 12:52:29 PM by mjethani

Developer Tools performance recording

comment:18 Changed on 11/23/2017 at 12:54:09 PM by mjethani

  • Owner set to mjethani

comment:19 Changed on 11/23/2017 at 12:58:13 PM by kzar

(getSelectorsForDomain always was a hotspot, we did some work optimising that a while ago. I suppose it's possible there was a performance regression there since.)

comment:20 Changed on 11/25/2017 at 06:59:41 PM by mjethani

I looked into this a little more today.

Basically Firefox is complaining that the content script is running for too long. In the case of the Developer Tools panel being open on https://9anime.is/watch/one-piece.ov8/4vo0xo, this can be seen by tracing the performance of ElementHidingTracer.checkNodes. There are ~18,700 selectors, and it has to run Document.querySelectorAll for each one of them and then iterate over the result. Sometimes this can take up to 10 seconds or even longer. This is a good page to test on, because it modifies the DOM every second or so (updating the video player UI), which causes ElementHidingTracer.checkNodes to run at regular intervals. I tried this particular page on Firefox 54.0.1 as well and sometimes there's a warning in that version too, though it disappears almost instantly. On Firefox 57 the warning appears more consistently and stays for longer.

Now here's the back story: It seems Firefox 57 has a lower threshold for what it considers to be a long running script. It's based on the new dom.max_ext_content_script_run_time preference and defaults to 5 seconds. The reason we're seeing this warning is clearly that some of the code in the content script is running for longer than 5 seconds.

There won't be one place in the code where we have this problem. We'll have to identify all the places and do something about it.

I haven't been able to reproduce this issue with the Developer Tools panel closed so I still don't know what part of the code is causing this warning to appear on @lsdornheim's machine. If I had to guess I'd say it has something to do with ElemHideEmulation and the way it responds to DOM mutations. I have also proposed some optimizations in that area.

Last edited on 11/25/2017 at 07:01:42 PM by mjethani

comment:21 Changed on 11/25/2017 at 07:12:57 PM by mapx

Probably you missed an important part, see https://issues.adblockplus.org/ticket/6067#comment:16

I mean, after getting the warning using 9anime site, I closed the devtools, then go to:
https://en.pons.com/translate?q=test&l=deen&in=&lf=de

I get the same warning error even without devtools.

I close firefox, go again to the same pons page (without devtools opened) and the page loads normally.

So, it's not only the content script runs over 5 seconds but after that there still are consequences. Memory leak ?

comment:22 Changed on 11/25/2017 at 08:29:53 PM by mjethani

@mapx do you go to pons.com in a new tab or the same tab? If it's a new tab, while you've kept 9anime.is open in the old tab (after closing Developer Tools), you'll still get the warning because the same code is still running.

I closed Developer Tools and went to pons.com in the same tab and was unable to get any warnings.

comment:23 Changed on 11/25/2017 at 08:33:54 PM by mapx

In the same tab after closing devtools. Every time.

comment:24 Changed on 11/25/2017 at 08:43:02 PM by mapx

I repeated the test in FF dev edition 58.0b6 (64-bit)

devtools opened, this time I got no warning on the 9anime page. I closed the devtools, I loaded (in the same tab) the pons page above and surprize => I get the warning FF message.

The other old tests were always in FF 58 beta version.

Last edited on 11/25/2017 at 08:44:43 PM by mapx

comment:25 Changed on 11/25/2017 at 08:51:22 PM by mapx

I repeated the test in dev edition but now when I open devtools I don't go into ABP panel (like before) => no issues anymore.

So, all the trouble is due to the ABP panel ?!

comment:26 Changed on 11/25/2017 at 09:01:02 PM by mjethani

The ABP panel in Developer Tools is one way to get the warning, but the original issue report does not say anything about opening Developer Tools. This is more fundamental.

I am also getting the warning now sometimes on Facebook, no Developer Tools.

comment:27 Changed on 12/04/2017 at 03:52:54 PM by rscott

I saw this happen for the first time earlier today on IRCCloud. Platform is FF57/Linux, ABP 3.0.1, Filters: EasyList, EasyPrivacy, Acceptable Ads. EasyPrivacy is out of date and for some reason hasn't been updated since 30 Nov.

The IRCCloud tab showed one item blocked, a Facebook beacon blocked by EasyPrivacy IIRC.

Looking at the output of top, you could see that one of Firefox's "Web Content" child process was maxing out CPU when the warning was popping up. Its memory usage was climbing quite rapidly too, up to about 15GB when I finally killed it, but by then I was using Dev Tools to try & figure out what was going on, which may have affected it as well.

comment:28 Changed on 12/21/2017 at 11:26:28 AM by fhd

  • Cc trev removed

comment:29 Changed on 03/30/2018 at 08:20:59 PM by mapx

go to
http://www.bournemouthecho.co.uk/

open the dev panel, refresh the page ==> FF message on unresponsive script, then the page loads again for some seconds, then again unresponsive ..

comment:30 Changed on 02/19/2019 at 09:56:04 PM by mapx

still unfixed

see: https://github.com/abp-filters/abp-filters-anti-cv/issues/57#issuecomment-465315850

adding a snippet causes the page becoming unresponsive / FF msg "slowing ..." , exactly the issue here

comment:31 Changed on 08/29/2019 at 05:43:18 PM by sebastian

  • Keywords closed-in-favor-of-gitlab added
  • Resolution set to rejected
  • Status changed from new to closed

Sorry, but we switched to GitLab. If this issue is still relevant, please file it again in the new issue tracker.

Add Comment

Modify Ticket

Change Properties
Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from mjethani.
 
Note: See TracTickets for help on using tickets.