twofas / 2fas-browser-extension

Source code for 2FAS Browser Extension
https://2fas.com/browser-extension
GNU General Public License v3.0
275 stars 37 forks source link

Extension slowing down sites #38

Closed Christophe999s closed 9 months ago

Christophe999s commented 9 months ago

Extension causes sites to take 100% CPU. Using MacBook Air M1, tested with both Waterfox and Brave. Disabling the extension solves the problem. With extension enabled, the page does not continue

Screenshot 2024-01-27 at 22 14 08

Screenshot 2024-01-27 at 22 14 33 With the extension disabled, page loads immediately

Screenshot 2024-01-27 at 22 16 08
claabs commented 9 months ago

I'm also seeing this on several sites on Firefox 122. Here's a random public site that experiences it.

I ran the profiler, and here's the stack trace of some code that gets 60% of the hits:

o [Extension "2FAS - Two Factor Authentication" (ID: admin@2fas.com): moz-extension://a7ae6c4b-9c0a-4c6e-9535-1cf4b9aa1e69/content/content_script.js:1:24708]
./src/content/observer/observerFunctions/checkChildNodes.js/o/< [Extension "2FAS - Two Factor Authentication" (ID: admin@2fas.com): moz-extension://a7ae6c4b-9c0a-4c6e-9535-1cf4b9aa1e69/content/content_script.js:1:24765]
map [self-hosted:221:18]
o [Extension "2FAS - Two Factor Authentication" (ID: admin@2fas.com): moz-extension://a7ae6c4b-9c0a-4c6e-9535-1cf4b9aa1e69/content/content_script.js:1:24708]
./src/content/observer/observerFunctions/checkChildNodes.js/o/< [Extension "2FAS - Two Factor Authentication" (ID: admin@2fas.com): moz-extension://a7ae6c4b-9c0a-4c6e-9535-1cf4b9aa1e69/content/content_script.js:1:24765]
map [self-hosted:221:18]
o [Extension "2FAS - Two Factor Authentication" (ID: admin@2fas.com): moz-extension://a7ae6c4b-9c0a-4c6e-9535-1cf4b9aa1e69/content/content_script.js:1:24708]
./src/content/observer/observerFunctions/addedNodes.js/e.exports/< [Extension "2FAS - Two Factor Authentication" (ID: admin@2fas.com): moz-extension://a7ae6c4b-9c0a-4c6e-9535-1cf4b9aa1e69/content/content_script.js:1:24251]
map [self-hosted:221:18]
./src/content/observer/observerFunctions/addedNodes.js/e.exports [Extension "2FAS - Two Factor Authentication" (ID: admin@2fas.com): moz-extension://a7ae6c4b-9c0a-4c6e-9535-1cf4b9aa1e69/content/content_script.js:1:24188]
./src/content/observer/createObserver.js/e.exports/</< [Extension "2FAS - Two Factor Authentication" (ID: admin@2fas.com): moz-extension://a7ae6c4b-9c0a-4c6e-9535-1cf4b9aa1e69/content/content_script.js:1:22528]
forEach [self-hosted:203:22]
./src/content/observer/createObserver.js/e.exports/< [Extension "2FAS - Two Factor Authentication" (ID: admin@2fas.com): moz-extension://a7ae6c4b-9c0a-4c6e-9535-1cf4b9aa1e69/content/content_script.js:1:22498]
MutationCallback

For now, I'm just disabling the extension.

cshafer2 commented 9 months ago

I'm seeing a similar slow down with dramatically increased loading times for my locally hosted Omada SDN controller. Loading times go back to normal after disabling the extension.

ScottESanDiego commented 9 months ago

I see that, and also some sites fail to load completely. E.g., the eBay "sell an item" page where you make a new listing. With 2FAS extension enabled it fails to completely load (Chrome shows the "X" icon not the "Reload" icon, and you can't change things like dropdown menu items on the page). Unclear if this is a side-effect of the CPU usage, or not.

GrzegorzZajac000 commented 9 months ago

Sorry for the inconvenience. I'm already working on a fix

GrzegorzZajac000 commented 9 months ago

I have just submitted version 1.6.1 for testing. If everything goes smoothly, the new version will be sent to extension stores within a few hours.

Kiyo5hi commented 9 months ago

I faced the same issue these few days. It takes forever to load Jupyter Lab. After disabling the extension, the page is loaded without issue.

aaron3238 commented 9 months ago

I am also experiencing the above issues. Thought it was me. Thanks for taking a look at it quickly.

GrzegorzZajac000 commented 9 months ago

v1.6.1 has been uploaded to stores. It should be visible in the next few hours.

Christophe999s commented 9 months ago

Thank you, just got the update and everything seems ok now!

MagsMagnoli commented 9 months ago

@GrzegorzZajac000 I'm on 1.6.1 (Firefox) and sadly still see the issue. Oddly it doesn't happen when I directly visit the page in question but when navigating to it via anchor tag.

Check it out:

Screenshot 2024-01-31 at 12 26 27

Screenshot 2024-01-31 at 12 25 05

ScottESanDiego commented 9 months ago

Good find @MagsMagnoli . I see the same behaviour on Chrome/Windows.

aaron3238 commented 9 months ago

@GrzegorzZajac000 I'm on 1.6.1 (Firefox) and sadly still see the issue. Oddly it doesn't happen when I directly visit the page in question but when navigating to it via anchor tag.

Check it out:

Screenshot 2024-01-31 at 12 26 27

Screenshot 2024-01-31 at 12 25 05

Can replicate same behavior on vivaldi/linux. Loads fine via anchor tag with extension disabled. Tried testing this with other sites that load large amounts of data in one go and I've had inconsistent results. Will try some others.

GrzegorzZajac000 commented 9 months ago

@MagsMagnoli @ScottESanDiego @aaron3238 Thanks for testing. I'll check it

GrzegorzZajac000 commented 9 months ago

Sorry for the bugs in v1.6.1. I have just released version 1.6.2 to QA, which should fix all of the above issues.

GrzegorzZajac000 commented 9 months ago

Sorry for slight delay, but we had few another problems. v1.6.2 was uploaded to stores. Should be available in near future for users. Thank you for patience ;)