You will need to install a user script manager extension to install this script.
This script tells YouTube that your browser only supports 30FPS or less, which means that you will see regular 30FPS versions of all HD videos.
For my six year old laptop, switching from 1080p60 to 1080p30 reduces the CPU usage by 2-4x, and removes all CPU overloads that used to make my browser and video playback freeze! This means longer battery life, and a much happier video watching experience!
(Furthermore, most older graphics cards only support hardware acceleration of 1080p30 or lower, which means that using this script may allow your graphics card to perform the video decoding for great battery savings!)
Install the Tampermonkey (https://tampermonkey.net) extension for your specific browser, and then install this script into Tampermonkey.
This script has been tested and confirmed working in Safari 9 for Mac and Google Chrome for Mac. But it should work in all browsers and OS's that support the Tampermonkey extension - on Windows, Mac and Linux!
(This script does NOT work via Chrome's own basic built-in script support!)
We DO NOT affect embedded YouTube videos, because embedded players only check for high-FPS support, so blocking those queries would mean completely losing all HD resolutions for embedded videos!
I suggest clicking the "Watch on YouTube" button to play embedded high-FPS videos directly on YouTube in 30FPS instead!
This script contains a workaround for a Safari bug. The Safari browser uses "lazy" extension loading, which means that your extensions (such as Tampermonkey) may sometimes run after the page scripts. And when that happens, YouTube may perform its codec check before the high-FPS format blocker has been injected, in which case YouTube will revert to giving you high-FPS videos in that tab. This "too late extension loading" in Safari is common enough to be annoying. Our chosen workaround is that whenever we detect that Safari has loaded Tampermonkey too late in the current tab, we perform a very quick reload of the current YouTube page so that the extension can run before YouTube does its codec check. This reloading is automatic and happens so quickly that most people won't even notice anything at all. I just mention it here for the few people who pay attention to such things.
The Safari web browser's extension loading bug is now much more common and much more severe since Safari 10 (and it affects ALL extensions, such as adblockers too, which is why you might now see ads in your Safari tabs). To prevent an endless loop of page reloads when your browser tab is completely bugged, this script will now (from v1.3) count the page reloads and will quickly give up if the current web tab seems to be hopelessly bugged. In that case, it displays a message bar letting you know that videos in the tab will play in high FPS mode if available, and it gives you some options to either retry or to restart your browser to fix the Safari bug. This is the best we can do for all of you Safari users! :) If you don't like it, complain to APPLE. They're the ones responsible for the browser bug!
Rewrote the "injection success?" detection method. Previously, we checked for the "window.ytplayer" object as a sign of too-late injection, but as of late 2017, the YouTube player now almost always has that object by the time that Tampermonkey in Safari runs. Therefore, the method has instead been changed to check if we've actually blocked any formats. If so, we're sure that we've successfully injected the format blocker and disabled high-FPS!