MacOS – Chrome CPU consumption alert script

cpugoogle-chromemacos

Sometimes a website on Chrome sneaks on me, and starts consuming >100% CPU continuously.
I only notice that when the fan is running full speed.

Then I use the Chrome Task manager to find the culprit and shut it down.
I do not want to investigate why some websites do that, just shut them down.

Question:

Is there a script or something, that would alert me if:
Chrome reports CPU usage >50% for a Tab for longer than a minute. (not for seconds, since most do that while loading)

Using the existing Chrome Task manager that already monitors CPU usage by Tab, would be nice, if I can just get an alert from it.
enter image description here

MacBook Air
OSX Sierra
Chrome Version 58.0.3029.110 (64-bit)

Example with one website acting up !

Best Answer

You should modify this script to your needs or check if it already solves them as-is

https://github.com/andyyoung/Process-Monitor-for-Chrome