🏠 Home 

Hide HDR support from YouTube

Hide HDR support for Firefox 69. v0.1 2019-10-10


Install this script?
  1. // ==UserScript==
  2. // @name Hide HDR support from YouTube
  3. // @author Jefferson "jscher2000" Scher
  4. // @namespace JeffersonScher
  5. // @version 0.1
  6. // @copyright Copyright 2019 Jefferson Scher
  7. // @license BSD-3-Clause
  8. // @description Hide HDR support for Firefox 69. v0.1 2019-10-10
  9. // @match https://www.youtube.com/*
  10. // @match https://www.youtube-nocookie.com/*
  11. // @match https://www.youtu.be/*
  12. // @run-at document-start
  13. // @grant none
  14. // ==/UserScript==
  15. var mse = window.MediaSource;
  16. if (mse){
  17. // Set up replacement for MediaSource type support function
  18. var nativeITS = mse.isTyp###pported.bind(mse);
  19. mse.isTyp###pported = ourITS(nativeITS);
  20. }
  21. // Here's the replacement
  22. function ourITS(fallback){
  23. // type is a string (hopefully!) sent by the page
  24. return function (type) {
  25. if (type === undefined) return '';
  26. //console.log('testing for: '+ type);
  27. // Don't support HDR (current as of 10/10/2019)
  28. if (type.toLowerCase().indexOf('eotf=bt709') > -1 ||
  29. type.toLowerCase().indexOf('eotf=catavision') > -1) return '';
  30. // Uncomment to block all VP9 (if performance is bad)
  31. //if (type.toLowerCase().indexOf('vp9') > -1) return '';
  32. // Let Firefox handle everything else
  33. return fallback(type);
  34. };
  35. }