How to alleviate Javascript CPU hogging?

Add-ons for Pale Moon and other applications
General discussion, compatibility, contributed extensions, themes, plugins, and more.

Moderators: FranklinDM, Lootyhoof

User avatar
Trinoc
Fanatic
Fanatic
Posts: 199
Joined: 2013-10-24, 18:09
Location: UK

How to alleviate Javascript CPU hogging?

Unread post by Trinoc » 2017-12-11, 21:33

Some web sites have lousy Javascript code that keeps hogging the CPU even when the page is no longer being assembled. I know it's the web designer's fault, but complaining to every host of a bad web page is about as effective as telling the tide to go back.

Even some supposedly highly professional sites have this problem. Check out Transport for London's status page:

https://tfl.gov.uk/tube-dlr-overground/status/

It's clearly possible for Palemoon to throttle Javascipt, since the CPU usage drops almost to zero if I select another tab. I have that page in a background tab at the moment and CPU use is normal until I select that tab again, then it goes to 99-100%.

I can stop a lot of sites doing this by disabling Javascript with NoScript (news sites that pop up requests to subscribe for example), but a lot of sites, such as the TfL one above, just don't work without Javascript support, and others have missing content.

Is there an extension or configuration parameter anywhere that can monitor Javascript CPU use and throttle back any tab that is hogging the CPU while it is doing nothing useful? Or at least limit the fraction of CPU time devoted to Javascript so that other Palemoon functions (not to mention other apps) can run without slowing to a crawl?

Locked