YouTube Window Size FullScreen

Window Size FullScreen for YouTube

  1. // ==UserScript==
  2. // @name YouTube Window Size FullScreen
  3. // @name:ja YouTube 全画面 ブラウザサイズ
  4. // @namespace https://midra.me
  5. // @version 1.0.1
  6. // @description Window Size FullScreen for YouTube
  7. // @description:ja YouTubeの全画面表示をブラウザサイズにするスクリプト
  8. // @author Midra
  9. // @license MIT
  10. // @match https://www.youtube.com/*
  11. // @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
  12. // @run-at document-start
  13. // @noframes
  14. // ==/UserScript==
  15.  
  16. (() => {
  17. 'use strict'
  18.  
  19. Element.prototype.requestFullscreen = function () {
  20. Object.defineProperty(document, 'fullscreenElement', {
  21. get: () => this,
  22. configurable: true,
  23. })
  24. document.dispatchEvent(new Event('fullscreenchange'))
  25. }
  26. Document.prototype.exitFullscreen = function () {
  27. Object.defineProperty(document, 'fullscreenElement', {
  28. get: () => null,
  29. configurable: true,
  30. })
  31. document.dispatchEvent(new Event('fullscreenchange'))
  32. }
  33. })()