jrie / flagCookies

A cookie manager, browser add-on to manage and flag cookies and session data. On stereoids.
https://dwrox.net
GNU General Public License v3.0
84 stars 6 forks source link

Enourmously slows down chrome. #3

Closed schmorp closed 10 months ago

schmorp commented 1 year ago

Enabling this extension slows down chromium a lot and incrreases CPU usage enourmously., Tab switching normally takes <0.2s, but with this extension enabled, it takes 1-2s or sometimes even more, at high cpu usage.

jrie commented 1 year ago

Hi, based on what the extension is allowed to do by permissions and what is used from inside the "tab" api, there is not such a thing as interacting with the browser on tab switching. Flag Cookies does not actively monitor this tab events.

schmorp commented 1 year ago

On Thu, Aug 31, 2023 at 08:34:09AM -0700, Jan Riechers @.***> wrote:

Hi, based on what the extension is allowed to do by permissions and what is used from inside the "tab" api, there is not such a thing as interacting with the browser on tab switching. Flag Cookies does not actively monitor this tab events.

Well, if I enable it in chromium - seconds to switch. If I disable it, almost instant.

In any case,. I gatherr this response means nothing will be done about it, thats fine, good luck in the future!

jrie commented 1 year ago

@schmorp , I tested on Chromium v116.0.5845.140 and I cannot reconstruct this issue. Do you make use of the "Memory Saver" feature of Chromium?

My best guess at this point would be, that when either the "Memory Saver" does its job - the tab load may be slowed down as those tabs became hibernated before and data has to be "reloaded", also the data of Flag Cookies, depending on how huge the cookie data is for each tab.

Another issue might be that your computer swaps the browser and or addon data, reloads it of a disk, which again would take quite some time to resume. I do not think that this case will happen, but it realy depends on your hardware/setup and browser usage/stats.

cheater commented 1 year ago

I'm having the same issue in Firefox 117 on Windows. I just installed FlagCookies the other day, and my Firefox took on the order of minutes to respond to clicks. I think it might be because I have a massive amount of tabs and windows open (I'm a power user alright).

cheater commented 1 year ago

Oh, also, eventually it leads to Firefox crashing. Restarting it does not help - it's still impossible to use the browser after a restart. The only thing that restores the browser to normal operation is disabling FlagCookies. Without FlagCookies, Firefox responds instantly to my inputs.

jrie commented 1 year ago

Thank you for your feedback. I am not sure on how much impact the addon has on your browsing experience. But this sounds bad and is unfortunate.

I am not exactly sure on how to start troubleshooting this issue. What might happen, a lot of data (cookie information) is processed in your cases. For some domains this might turn to a bigger amount of cookie information, the displayed data, the logging information as well as what is loaded into the browser storage and needs be processed by the browser for the addon to work accordingly. This might apply across all tested browsers.

FlagCookies does also do a lot of background work, meaning, if there is a lot of "background loading" in a tab, for example by XMLHttpRequests/AJAX, or other changes like cookie "activity", things might become crowded if the tab is kept open in the background and such loads, or activity is done. I just can imagine, a lot of (cookie) name data is collected and needs to be sorted out for the extension to work, and things become crowded.

In order to improve the situation for this particular use cases, I would require more information. For example how big the stored data of FlagCookies is - meaning the overall settings, profile mode cookies, and other settings which apply for domains/tabs and such.

Since this might be sensitive or private information, you can also drop me an email.

cheater commented 1 year ago

How would i find that out?

jrie commented 1 year ago

Hi @cheater - in Firefox you can visit the about debugging page.

about:debugging

ATTENTION: This cookieData will have the cookie information, DO NOT POST THIS PUBLICLY!

There, you select "This Firefox" or "Dieser Firefox" in German and scroll in the extension list to "Flag Cookies" and click on "Inspect" / "Untersuchen". In the new window you click on "Debugger" and select "Flag Cookies" in the list.

To see all the data Flag Cookies uses for "cookies", enter in the console: cookieData

And press enter - this will show an "Object {..." something, if you click on this, it will show you all data stored in the cookie information store. Depending on how much data there is, this might take some time.

If you want to copy this data, you click right on "Obect {..." and choose "Copy object". All that data is in the clipboard then.

The same can go for "logData" (like the "cookieData"), and "logTime".

jrie commented 1 year ago

I was working on some changes during the weekend. Improving some of the data usage and also improved the code to not store as much temporary information for cookies and there data, stripping out non required details.

Also the cpu usage should be not as heavy if logging will be switched off, plus point, less data.

I try to get this version soon ready.

cheater commented 1 year ago

can you push out the new version? I wanted to try it out before i blow up my computer with the old version again

jrie commented 1 year ago

Hi @cheater - I just pushed the new version. Please take a closer look!

There are some smaller improvements, some smaller enhancements and some simplifications across the addon as well as some more housekeeping.

Please let me know, if this version is working better for your use case! :+1:

cheater commented 1 year ago

how do i get it? it's not on AMO and i don't see a place on github to get the xpi.

jrie commented 1 year ago

You can download the repository and then use the about:debugging URL in the address bar of Firefox. There, select "this firefox" and click on "load temporary addon" and navigate to the folder of FlagCookies, containing the manifest.json.

cheater commented 1 year ago

well, it doesn't slow down my browser now, but also it doesn't do anything. when i go to export cookies (which is why i'm using flagCookies in the first place - to use with jdownloader), it just gives me this string:

{"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0"}

those are not my instagram cookies...

farOverNinethousand commented 1 year ago

@cheater Close all open browser tabs, close your browser, re-open your browser and check if it works now.

cheater commented 1 year ago

what? no. i'm not closing my tabs to test something. it makes no sense. and besides, i'm on firefox, not chrome.

farOverNinethousand commented 1 year ago

I've edited my post accordingly.

I was able to reproduce the issue under Chrome too hence my initial post was about Chrome. If you are not willing to invest some time into testing developers' changes, maybe you shouldn't report bugs at all on this platform.

cheater commented 1 year ago

what are you even talking about? i reproduced the issue, and jrie made a new version, i tested that, and it's broken because it does not do anything. you're out of your mind dude. go annoy someone else.

farOverNinethousand commented 1 year ago

Okay again: I was able to reproduce a similar issue in Chrome using a very similar addon. In Firefox, it is working fine for me with Instagram now. When it wasn't working, this is what I did: Close all open browser tabs, close browser, re-open browser and check if it works now.

I've attached a screenshot which shows that the new build is working fine with Instagram after a browser-restart.

FlagCookiesIG

jrie commented 1 year ago

Hello. I am working on some fixes to FlagCookies since the last upload to Github.

These changes will hopefully change the error of disapearing cookies under some circumstances.

I believe the new version might soon be ready at the weekend after this week, or something between this lines.

Please bare with me.

cheater commented 1 year ago

No worries, let me know when you're ready.

I wanted to provide a suggestion on your coding technique. I've been trying to debug the issue by going over the git log. However, it's unusable. You do massive commits where everything is thrown in. It would be much more useful - also to yourself - if you made commits more granular. Just one small change in functionality, and then commit. It doesn't cost much. Make sure the plugin still is in working order when you commit. So for example, if you'll be replacing a bunch of code, try to replace it step by step rather than everything in one go. This way, you could right now go through the git history, and find where the issue started happening, with more granularity than we can do right now. Currently it's only possible to narrow this down to a diff with thousands of lines.

If you have to program a bunch of stuff before you can figure out what you'll be doing, try using the git gui command. It opens a visual commit window. In the file view, you can use your mouse to select single lines to add to the staging pool to commit them. This way you can select out a feature made up of disjoint lines and commit it all in one go while also not committing lines that are not related to it. It's much better than the text-interactive version in the command line, which technically allows you to do something similar, but the user interface is so confusing you can lose track of what you want to do.

Good luck on the debugging! Take your time.

jrie commented 12 months ago

I updated the code base here at Github. This version should fix the reported issues. This is a larger commit, once more, but there have been a lot of changes (for better!).

jrie commented 11 months ago

@cheater @schmorp - a update is live here at Github which further should trim down the memory and cpu usage. Also for power users. This is also a bugfix release.

I would be glad if you could test the version 3.3.0 here from Github.

cheater commented 11 months ago

it works, copies the cookies to the clipboard, and (after only a minutes of use) doesn't seem to be slowing down the browser. well done! thank you for fixing it :) you should publish it to AMO.

cheater commented 11 months ago

Would you mind telling us in detail what you did to make it perform better? I'm curious and would like to learn from your experience :)

cheater commented 11 months ago

(btw i'm on FF. haven't tried on chrome, i don't use it, i have it installed but i have 0 tabs open and websites logged in, so i don't think that would help)

jrie commented 11 months ago

Would you mind telling us in detail what you did to make it perform better? I'm curious and would like to learn from your experience :)

From what I did:

At least those are the most Important changes from my side.

cheater commented 11 months ago

Thanks! That sums it up well. One question... will JDownloader still be able to use the cookies, or is the "copy to clipboard" format different now?

jrie commented 11 months ago

Thanks! That sums it up well. One question... will JDownloader still be able to use the cookies, or is the "copy to clipboard" format different now?

The format has not changed, so the export to clipboard should work as expected.

I plan to upload a new version tomorrow or Saturday here at Github which will fix some errors I noticed when testing the addon in Chrome and Opera, which did not fire in the Firefox codeparts explicitly.

cheater commented 11 months ago

Thanks! That sums it up well. One question... will JDownloader still be able to use the cookies, or is the "copy to clipboard" format different now?

The format has not changed, so the export to clipboard should work as expected.

I plan to upload a new version tomorrow or Saturday here at Github which will fix some errors I noticed when testing the addon in Chrome and Opera, which did not fire in the Firefox codeparts explicitly.

are you suuuure nothing's changed? because when I use those cookies in JDownloader now, it can't log into instagram. I tried another thing called Cookie-editor that's now also supported by JDownloader. Cookies copied out of it log me in fine. However, the format is different, and also it includes more cookies.

So if the format is the same as it was before, then I assume JD supports two different formats: yours and Cookie-editor's. But maybe you have an issue where you aren't capturing all the cookies anymore?

Try comparing the output on instagram yourself (you have to be logged in).

cheater commented 11 months ago

For example, Cookie-editor includes cookies named "sessionid", "mid", "ig_did", and a bunch more and those cookies are not included in the output from the latest version of flagCookies.

jrie commented 11 months ago

For example, Cookie-editor includes cookies named "sessionid", "mid", "ig_did", and a bunch more and those cookies are not included in the output from the latest version of flagCookies.

I am in touch with someone of the JDownloader team and we tested the login in JDownloader2. This does work on Instragram with the exported cookies into clipboard.

In any case, you might need to reload the tab for FlagCookies to update the temporary cookie information. Or in worst, once restart the browser - but a tab reload also should to the trick.

cheater commented 11 months ago

Have you guys tried with Facebook Container turned on? (that puts Instagram and other FB owned entities in their own tab container).

I reloaded the tab when I was testing, but I did not restart the browser - I don't see what that would do since the addon is loaded as a temporary addon.

jrie commented 11 months ago

Hi. I have not tested Facebook Container, so I cannot tell if this will work. But support for contexts / contextual identities - was added some time ago. In Firefox in particular, you always see the "active container group" information underneath the currently active website/domain name.

Regarding the browser restart, indeed, if the addon is temporary installed, FlagCookies will become dropped - this only applies to a non-temporary installation.

Reloading the website, after FlagCookies has been added temporary and is enabled, updates the cookie information accordingly. Then you should see the cookies for Instagram or any other page.

jrie commented 11 months ago

@cheater , I opened up a new issue here: https://github.com/jrie/flagCookies/issues/6 regarding the (currently) broken container group support in Firefox.

jrie commented 10 months ago

Github version 3.4.0 is live which received some changes, which further should trim some temporary stored informations. This version also adds browser session display and, for now, the option to clearthe session and locale browser storages used by many websites.