internetarchive / wayback-machine-webextension

A web browser extension for Chrome, Firefox, Edge, and Safari 14.
GNU Affero General Public License v3.0
622 stars 207 forks source link

High CPU Utilization #1031

Open cgorringe opened 1 month ago

cgorringe commented 1 month ago

Describe the bug

A patron reported on the Chrome web store on May 31, 2024:

I don't know what happened but the extension is now using so much CPU on the latest Chrome Beta. Had to disable it on my laptop where the extra cpu usage was quite noticeable. Is there a bug? A crypto miner? No clue.

Environment (please complete the following information):

Additional context The latest v3.4 Manifest v3 was just released the same day, so it is likely due to that update.

the-lambda-way commented 1 month ago

I'm facing the same issue (I commented on the web store as well, as Mike Castillo). I'm willing to help diagnose this.

Environment (please complete the following information):

the-lambda-way commented 1 month ago

I did some experimenting with the extension in DevTools. When I switched to a random tab I encountered this error in the console:

background.js:880 Uncaught (in promise) TypeError: toolbarState.has is not a function
    at autoSave (background.js:880:65)
    at background.js:747:9
autoSave @ background.js:880
(anonymous) @ background.js:747

I'm not a javascript programmer, so please excuse my speculation; but maybe line 879

toolbarState = getToolbarState(atab)

should be

toolbarState = await getToolbarState(atab)

?

azure-06 commented 4 weeks ago

Not sure if it's related but when having the extension enabled, the ExtensionActivityEdge file in %localappdata\Microsoft\Edge\User Data\Default\ rapidly grows in file size, reaching 20 gigabytes in just a couple hours, Chrome has a similar file somewhere I believe possibly called just ExtensionActivity. Can someone check that file for me? And it's weird too, it only starts to increase in size after a certain amount of time. I had the same problem as people on the Chrome Web Store support page, like lag when inputting text, except for me it's a memory issue, not CPU. If it's not related in the end I'll see myself out

Environment:

cgorringe commented 4 weeks ago

Thanks @the-lambda-way and @azure-06 for your bug reports. Due to their severity we've rolled-back the extension to the prior version (now listed as v3.4.1)

azure-06 commented 4 weeks ago

My problem seems to be fixed. That file is only increasing in size when something happens like a refresh (regardless of whether the extension is turned off or on) and only by a few bytes. Still, what a weird file though, I don't think it ever gets cleaned as if it were a temp file, it just grows and grows. Anyway thanks a lot!