Hello,
Some users of my Firefox extension have reported a CPU overload when having the extension enabled.
The problem seems to only occur to very few users and unfortunately I wasn’t able to reproduce this problem and have therefore trouble fixing it.
Theoretically the extension is not involved in heavy CPU usage and in all my tests this held true.
I was hoping for some hints on which WebExtensions APIs could be involved in CPU overloads?
Here the list of permissions
in manifest.json:
<all_urls>
, storage
, activeTab
, tabs
, notifications
, menus
, clipboardWrite
and webNavigation
In addition the extension is using management
, pageAction
, runtime
*, sidebarAction
**, windows
*) I use both one-off communication between background and content scripts and ports between background and priviliged scripts (sidebar, toolbar menu)
Due to a bug the background connects a port to the sidebar script and vice versa and also to itself -> so i.e. background is connecting to sidebar, sidebar to background, background to background, sidebar to sidebar - could this lead to CPU overloads on some systems and have no significant effect on others?
**) The sidebar will update very frequently and also each time the user changes the tab
One helpful user experienced a CPU usage of 100% on MacOS as well as Linux right after Firefox updated to version 76.0, but since the problem is not new it’s not something specifically related to FF 76 - but maybe to the updating process itself(?)
Any hints on which APIs are most likely involved in heavy unintended CPU usage or how the problem could be debugged are very welcome!