Skip to content

[BUG] Zen (firefox fork) browser extension increased CPU usage #747

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
PaulMcF1987 opened this issue Apr 1, 2025 · 5 comments
Open

[BUG] Zen (firefox fork) browser extension increased CPU usage #747

PaulMcF1987 opened this issue Apr 1, 2025 · 5 comments
Labels
bug Something isn't working

Comments

@PaulMcF1987
Copy link

Describe the bug
Firefox browser Extension Ramps up CPU usage.
With alias vault running, my CPU usage on Zen(firefox) is around 25%, when I disable this extension the CPU usage for Zen drops to around 1-2%

I disabled all extensions and re-enabled 1 by 1 to diagnose the problem extension and it turned out to be this one

with aliasvault enabled:

Image

with alias Vault disabled:

Image

@PaulMcF1987 PaulMcF1987 added the bug Something isn't working label Apr 1, 2025
@lanedirt
Copy link
Owner

lanedirt commented Apr 1, 2025

Hi @PaulMcF1987,

Thanks for reporting this issue and for taking the time to narrow it down!

I haven’t been able to reproduce the high CPU usage on my end yet. Could you check if the CPU spike happens immediately after enabling the extension, or only when visiting/browsing a specific website or page? It would be especially useful to know if the behavior is triggered by certain website structures, as it might relate to the autofill mechanism.

@lanedirt lanedirt changed the title [BUG] [BUG] Firefox browser extension increased CPU usage Apr 1, 2025
@lanedirt
Copy link
Owner

lanedirt commented Apr 1, 2025

Update: after installing the Zen browser on Mac myself (Firefox fork) I do notice the increase in CPU usage myself too. It seems to max out 1 CPU core instantly as soon as the extension is enabled. This however does not happen on the official Firefox browser for me.

I'll look into this further to see if I can pinpoint what is going wrong with the Zen browser specifically.

@lanedirt lanedirt changed the title [BUG] Firefox browser extension increased CPU usage [BUG] Zen (firefox fork) browser extension increased CPU usage Apr 1, 2025
@PaulMcF1987
Copy link
Author

It seems to run high for the full the that the extension is open

Untitled.video.-.Made.with.Clipchamp.mp4

You will see from the vido that CPU starts quite low (I have 2 browser windows open) when I enable Alias Vault it spikes and stays there until I disable it

@PaulMcF1987
Copy link
Author

Update: after installing the Zen browser on Mac myself (Firefox fork) I do notice the increase in CPU usage myself too. It seems to max out 1 CPU core instantly as soon as the extension is enabled. This however does not happen on the official Firefox browser for me.

I'll look into this further to see if I can pinpoint what is going wrong with the Zen browser specifically.

I was actually going to ask if this might be specific to Zen. I also, wasnt sure if there might have been a conflict with bitwarden but it doesnt seem like that would be the issue

@lanedirt
Copy link
Owner

lanedirt commented Apr 2, 2025

After some thorough debugging, I concluded the issue was caused by the AliasVault contentScript injectIcon method which injects the AliasVault autofill icon to login forms. If I remove this method call, the CPU drops. However the strange thing is, if I add an invalid if check around that method in content.ts, e.g:

            if ('aaa' === 'bbb') {
              injectIcon(target, container);
            }

Even though this change would prevent the method from actually firing, the CPU in the Zen browser still spikes to 100%. Also, the injectIcon method itself does not contain any issues that I can see, as it works properly in all other browsers.

After some digging in the Zen repository I do see that other people have reported issues with high CPU too:

The first issue mentions that this bug can be related to the New empty tab that the Zen browser opens. And I can confirm this, because if I kill the following process via task manager that causes the high CPU, the Zen empty tab crashes:

Image Image

But after that tab has crashed, the CPU is back to 1-2% levels, and the browser still works:

Image

It seems the Zen browser has applied a fix in this PR:

So I hope that in the next release of the Zen browser this issue will be automatically fixed. I'll keep this issue open so we can retest this issue in the Zen browser with the next release (> 1.10.3b).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants