Closed Bug 2025327 Opened 6 months ago Closed 4 months ago

Add-on incorrectly blamed for slowing down Firefox

Categories

(WebExtensions :: Untriaged, defect)

Firefox 148
defect

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: firefox, Unassigned, NeedInfo)

Details

Steps to reproduce:

I received a report from a user of my add-on (distributed independently) with a screenshot of Firefox claiming that my add-on "is slowing down Firefox. To speed up your browser, stop that extension." I asked the user to disable my add-on, and the slowdown continued to occur. It turns out that the real cause was not my add-on but rather a userscript run by AdGuard.

I don't currently have steps to reproduce, but I could work on that. For this purpose, it would be very helpful if someone could explain to me how exactly Firefox attributes the cause of a page slowdown.

The Bugbug bot thinks this bug should belong to the 'WebExtensions::Untriaged' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Product: Firefox → WebExtensions

Based on what comment 0 describes, it is likely that AdGuard may have injected into a page some logic in a form that is not tied to the extension itself (e.g. js code evaluated into the page itself) and if the other add-on access that (e.g. through a polyfill injected by adguard into the page) and the code from adguard made the main thread to get stuck, then the locked down process would be notified to the parent process as something that the other extension has triggered.

Without an STR to reproduce the issue consistently we can't confirm what I'm describing above matches exactly what is happening but it is realistically possible based on how that "is slowing down Firefox..." warnings are being detected in the child web content processess and reported to the main Firefox process.

We will leave this bug open for a couple of weeks in case you may be able to come up with an STR, and eventually closing an INCOMPLETE if we can't make it actionable by that time.

Hello,

I’ve attempted to check the interaction between AdGuard Adblocker and Enhancer for Youtube on https://www.youtube.com/.

In the AdGuard Adblocker settings, I’ve enabled all the filters I could in the hopes that it will inject some scripts into the page which the other extension tries to leverage as well.
So far, after around 30 minutes of navigation through YouTube, there was no warning that any extension slows down the browser.

There is a perceived slowness when clicking on a video and until playback starts, so clearly all the filters from AdGuard and possibly the custom UI injected by Enhancer for YouTube slow down the browser, but not to the point in which a warning pops up.
The slowness goes away when AdGuard is disabled.

I’ll continue exploring this avenue and maybe I will reproduce the issue.

It might be handy to have your extension to test with that and maybe know what custom scripts/filters the user has enabled in AdGuard.

Tested on the latest Firefox Release (149.0/20260318190823) under Windows 11.

The severity field is not set for this bug.
:rpl, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(lgreco)

Hi Alex, would you mind to collect GeckoProfiler data while Firefox is experiencing the slowness side effect that you mentioned in comment 3 by using the STR you got so far?

Even if it is not technically triggering the slowscript notification based on what you describe in comment 3 makes me think that we may at least be able to see what is triggering that responsiveness issue which may also be the one triggering the slow script notification under different system conditions or system resources actually available.

Flags: needinfo?(lgreco) → needinfo?(acornestean)

Hey Luca !

As in Comment 3, I’ve installed both extensions and have enabled all filters in Adguard Adblocker. Then I navigated through several YouTube videos until playback started showing some delay from the initial clicking on the video, before capturing the profiler data here: https://share.firefox.dev/3OV50IJ .

I’ve done a custom capture with all threads enabled, but in case you need me to capture certain specifics, let me know.

Flags: needinfo?(acornestean)
Flags: needinfo?(lgreco)

I don't currently have steps to reproduce, but I could work on that. For this purpose, it would be very helpful if someone could explain to me how exactly Firefox attributes the cause of a page slowdown.

Hi Jeff,
The slow script notification is triggered from the child process where youtube is running from here in XPCJSContext::InterruptCallback: https://searchfox.org/firefox-main/rev/a249a43995d7634e6e4a56bfd6496039031648bc/js/xpconnect/src/XPCJSContext.cpp#794-795

And the addon id is retrieved a few lines before in the same method from the subject principal: https://searchfox.org/firefox-main/rev/a249a43995d7634e6e4a56bfd6496039031648bc/js/xpconnect/src/XPCJSContext.cpp#683

I can't dig any deeper than that without knowing exactly what the other extension installed along with AdGuard is doing in the content process that is then detect that extension as the one slowing down the webcontent process where youtube is running, but hopefully these additional details may help you to determine more precise steps to reproduce that could allow us to consistently reproduce the issue with a minimal test extension and dig some more into it.

Flags: needinfo?(lgreco) → needinfo?(firefox)

Closing as incomplete but we can consider re-opening if we get additional details that could make it actionable.

Status: UNCONFIRMED → RESOLVED
Closed: 4 months ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.