brcontainer / prevent-duplicate-tabs

Simple add-on/extension for prevent duplicate tabs
MIT License
62 stars 7 forks source link

fix: check tab.pendingUrl and add a delay to avoid high CPU usage #22

Closed gera2ld closed 1 year ago

gera2ld commented 2 years ago

In some cases the navigation cannot be performed immediately, e.g. slow network connection, waiting for IPFS to resolve. As a result, tab.url will be empty and the URL to be navigated is in tab.pendingUrl. See the docs.

In such cases, this extension will try to check tab.url infinitely without any delay, leading to high CPU usage (around 100%) and computer fan noise.

The fix is to check pendingUrl as well as url, and if that fails too, add a delay before the next check.

brcontainer commented 1 year ago

Thanks! I'm uploading the update for firefox-addons, chrome web-store, edge extensions, and opera extensions.