YouTube Normal Thumbnails

Restores normal thumbnails size

  1. "use strict";
  2. // ==UserScript==
  3. // @name YouTube Normal Thumbnails
  4. // @namespace http://greatest.deepsurf.us
  5. // @version 0.7.1
  6. // @description Restores normal thumbnails size
  7. // @author NeoCortex
  8. // @license MIT
  9. // @match *://www.youtube.com/*
  10. // @match *://youtube.com/*
  11. // @run-at document-start
  12. // @grant none
  13. // ==/UserScript==
  14. (function () {
  15. var styles = "\n ytd-rich-grid-video-renderer[mini-mode] #video-title.ytd-rich-grid-video-renderer {\n font-size: 1.4rem;\n font-weight: 500;\n line-height: 1.6rem;\n }\n\n #avatar-link.ytd-rich-grid-video-renderer {\n display: none !important;\n }\n\n ytd-video-renderer[use-prominent-thumbs] ytd-thumbnail.ytd-video-renderer {\n min-width: 120px !important;\n max-width: 240px !important;\n }\n ".trim();
  16. var YoutubeThumbnailsFixer = /** @class */ (function () {
  17. function YoutubeThumbnailsFixer() {
  18. var _this = this;
  19. this.replaceMathMin();
  20. document.addEventListener("DOMContentLoaded", function () { return _this.installStyle(styles); });
  21. }
  22. YoutubeThumbnailsFixer.prototype.replaceMathMin = function () {
  23. var origMathMin = Math.min;
  24. function modifiedMathMin() {
  25. if (/calcElementsPerRow/img.test(Error().stack || '')) {
  26. return origMathMin.apply(Math, arguments) + 1;
  27. }
  28. return origMathMin.apply(Math, arguments);
  29. }
  30. Math.min = modifiedMathMin;
  31. };
  32. YoutubeThumbnailsFixer.prototype.installStyle = function (contents) {
  33. var style = document.createElement('style');
  34. style.innerHTML = contents;
  35. document.body.appendChild(style);
  36. };
  37. return YoutubeThumbnailsFixer;
  38. }());
  39. new YoutubeThumbnailsFixer();
  40. })();