mozilla / contain-facebook

Facebook Container isolates your Facebook activity from the rest of your web activity in order to prevent Facebook from tracking you outside of the Facebook website via third party cookies.
Mozilla Public License 2.0
986 stars 177 forks source link

Facebook Container consumes large amount of memory and CPU, computer becomes hard to use #883

Open vigilantesculpting opened 2 years ago

vigilantesculpting commented 2 years ago

Problem:

1) Ensure Facebook Container extension is ENABLED. 2) Browse to a site that uses Facebook tracking (in my case, https://www.artstation.com) 3) Open about:processes in a new tab

Result:

The memory and CPU usage of the artstation tab quickly grows to >1GB and 90% CPU, starving other processes and slowing down computer. I cannot log in succesfully to the Artstation site. Firefox itself becomes unusable, and I have to Force Quit it.

Control behaviour

4) Ensure Facebook Container extension is DISABLED. 5) Browse to a site that uses Facebook tracking (in my case, https://www.artstation.com) 6) Open about:processes in a new tab

Result:

The memory and CPU usage of the artstation tab stays low (~200MB and <1% CPU). The computer (and Firefox) remains usable, I am able to log into Artstation and do other tasks.

Notes

Firefox 105.0.3 (64-bit) on MacBook Pro running Monterey

Support information:

Application Basics Name Firefox Version 105.0.3 Build ID 20221007134813 Distribution ID
Update History
Update Channel release User Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:105.0) Gecko/20100101 Firefox/105.0 OS Darwin 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:54 PST 2021; root:xnu-8019.61.5~1/RELEASE_X86_64 Rosetta Translated false Application Binary /Applications/Firefox.app/Contents/MacOS/firefox Enabled Plugins about:plugins Build Configuration about:buildconfig Memory Use about:memory Performance about:processes Registered Service Workers about:serviceworkers Multiprocess Windows 1/1 Fission Windows 1/1 Enabled by default Remote Processes 11 Enterprise Policies Inactive Google Location Service Key Found Google Safebrowsing Key Found Mozilla Location Service Key Found Safe Mode false Memory Size (RAM) 16.0 GB Disk Space Available 650 GB

Add-ons Name Type Version Enabled ID Adblock Plus - free ad blocker extension 3.14.2 true {d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d} Add-ons Search Detection extension 2.0.0 true addons-search-detection@mozilla.com Amazon.com extension 1.3 true amazondotcom@search.mozilla.org behind! extension 0.2.20 true {d6005a62-1fdb-4cf2-b5ef-21b865d894f7} Bing extension 1.3 true bing@search.mozilla.org Don't Accept image/webp extension 0.8.2 true dont-accept-webp@jeffersonscher.com DuckDuckGo extension 1.1 true ddg@search.mozilla.org DuckDuckGo Privacy Essentials extension 2022.8.25 true jid1-ZAdIEUB7XOzOJw@jetpack eBay extension 1.3 true ebay@search.mozilla.org Enhancer for YouTube™ extension 2.0.115 true enhancerforyoutube@maximerf.addons.mozilla.org Facebook Container extension 2.3.5 true @contain-facebook Feedbro extension 4.12.7 true {a9c2ad37-e940-4892-8dce-cd73c6cbbc0c} Firefox Multi-Account Containers extension 8.0.7 true @testpilot-containers Google extension 1.2 true google@search.mozilla.org Greasemonkey extension 4.11 true {e4a8a97b-f2ed-450b-b12d-ee082ba24781} HTTPS Everywhere extension 2021.7.13 true https-everywhere@eff.org Image Picka extension 0.15.1 true image-picka@eight04.blogspot.com Notes by Firefox extension 4.3.7 true notes@mozilla.com Save In… extension 3.6.0 true {72d92df5-2aa0-4b06-b807-aa21767545cd} Tree Style Tab extension 3.9.5 true treestyletab@piro.sakura.ne.jp uBlock Origin extension 1.44.4 true uBlock0@raymondhill.net Web Developer extension 2.0.5 true {c45c406e-ab73-11d8-be73-000a95be3b12} Wikipedia (en) extension 1.1 true wikipedia@search.mozilla.org Google Images Restored extension 0.4.5 false {1b9d501d-1895-4bdc-80a1-87b349fdc333}

Experimental Features Name Value about:home startup cache (browser.startup.homepage.abouthome_cache.enabled) false Cookies: SameSite=Lax by default (network.cookie.sameSite.laxByDefault) false Cookies: SameSite=None requires secure attribute (network.cookie.sameSite.noneRequiresSecure) false CSS: Masonry Layout (layout.css.grid-template-masonry-value.enabled) false Developer Tools: Compatibility Panel (devtools.inspector.compatibility.enabled) true Developer Tools: Service Worker debugging (devtools.debugger.features.windowless-service-workers) false Media: JPEG XL (image.jxl.enabled) false Address Bar: show results during IME composition (browser.urlbar.keepPanelOpenDuringImeComposition) false Web API: WebGPU (dom.webgpu.enabled) false WebRTC Global Mute Toggles (privacy.webrtc.globalMuteToggles) false

f-loki commented 2 years ago

Confirming I have a similar issue

thedoctar commented 2 years ago

I also have this problem, using Lubuntu 20.04. Maybe the FB tracking script is bugging out in the container?

ospalax commented 2 years ago

Also seeing this on Linux (fedora) - non-distro binary update channel - 102.3.0esr (64-bit).

sstanojevic commented 2 years ago

Same here, Windows 10, Firefox 105.0.3 (64-bit), Facebook Container 2.3.5. Firefox becomes sluggish, constantly uses 15-16% CPU (on 12 core system), sites stop loading, even tab switching stops. about:performance shows High usage for Facebook container.

willdurand commented 2 years ago

Hi, quick question: is this a new problem that started about 24 hours ago? I am asking because I don't think we updated the extension recently (last update was about 3 weeks ago).

thedoctar commented 2 years ago

Yes, it's a new problem.

sstanojevic commented 2 years ago

Hi, quick question: is this a new problem that started about 24 hours ago? I am asking because I don't think we updated the extension recently (last update was about 3 weeks ago).

Yes, it started recently. Facebook Container in about:addons shows "Last Updated: October 11, 2022"

willdurand commented 2 years ago

Yes, it started recently. Facebook Container in about:addons shows "Last Updated: October 11, 2022"

Ok, this is when the add-on was last updated for you (even though the latest version was submitted to AMO ~3 weeks ago, you only received the update on October 11 - that isn't a problem in itself but it's good to know).

Did others receive the update (2.3.5) on October 11 as well?

willdurand commented 2 years ago

Scratch that, although the add-on was submitted a few weeks ago, it looks like it was only approved recently, which would explain why this is a new problem for most people.

wagnerand commented 2 years ago

We have reverted the version to the previous one and pushed it as an update (version 2.3.6).

AlexNodex commented 2 years ago

Having same issue, doens't happen on Windows, happens on macos 12.6 (M1) and 12.6 (Intel)

What I've narrowed it down to is either an ajax request or "replaceWith" when clicking links

The code that alerted me to it was a bunch of links that you can click and they do a fetch request and "replaceWith" an element with their response. Once you replace the content that's when the CPU goes crazy and the tabs are completely unresponsive.

willdurand commented 2 years ago

For all affected users, sorry. With the version 2.3.6 available, you could manually "check for updates" in about:addons to install version 2.3.6 over 2.3.5 and that should resolve the perf issue described here.

karypid commented 2 years ago

I just came across this and have reliable way to reproduce. See my comment on phoronix here.

When I press the next/prev buttons in the Phoronix forum threads (like the one linked) this happens.

I'm running version 2.3.5 in Firefox 105.0.3 on Windows 11.

AlexNodex commented 2 years ago

I just came across this and have reliable way to reproduce. See my comment on phoronix here.

When I press the next/prev buttons in the Phoronix forum threads (like the one linked) this happens.

I'm running version 2.3.5 in Firefox 105.0.3 on Windows 11.

This is because the paginated results (next and prev page etc) are loaded via AJAX (XmlHttpRequest) and they replace the content with the response of the request (the next or prev page data)

It's the "replace" part of the functionality that the plugin is interfering with and thus causing the slow down.

There is a fix - all you need to do is update from 2.3.5 to 2.3.6 inside your extensions settings

karypid commented 2 years ago

This is because the paginated results (next and prev page etc) are loaded via AJAX (XmlHttpRequest) and they replace the content with the response of the request (the next or prev page data)

It's the "replace" part of the functionality that the plugin is interfering with and thus causing the slow down.

There is a fix - all you need to do is update from 2.3.5 to 2.3.6 inside your extensions settings

Yep, can confirm that fixed it!

vigilantesculpting commented 2 years ago

Updating the extension from 2.3.5 to 2.3.6 fixed the issue on for me.

On both my desktop and macbook Firefoxes, the "Automatic Update" setting was set to "Default", as opposed to "On" (or "Off"). I presume "Default" in this case means "Off".

My suggestion would be to make the "Default" setting be "On", since Facebook is always evolving its trackers and it would be great to not have to manually check for updates, especially with this extension and its implications for privacy.

Thanks!

diox commented 2 years ago

The default setting does mean On... but Firefox only automatically checks for updates every 24 hours to avoid stressing the update servers too much.

vancouverbluesea commented 2 years ago

Updating the extension from 2.3.5 to 2.3.6 fixed the issue on for me.

Thank you! 2.3.5 was updated yesterday (as per my system). Didn't know there is 2.3.6

alechko commented 2 years ago

2.3.6 fixed the issue for me, thanks!

willdurand commented 2 years ago

@maxxcrawford can we close this issue now?