YouTube Window Size FullScreen

Window Size FullScreen for YouTube

当前为 2022-10-03 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name YouTube Window Size FullScreen
  3. // @name:ja YouTube 全画面 ブラウザサイズ
  4. // @namespace https://midra.me
  5. // @version 1.0.0
  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. Element.prototype.requestFullscreen = function () {
  19. const element = this
  20. Object.defineProperty(document, 'fullscreenElement', {
  21. get() { return element },
  22. configurable: true,
  23. })
  24. document.dispatchEvent(new Event('fullscreenchange'))
  25. }
  26. Document.prototype.exitFullscreen = function () {
  27. Object.defineProperty(document, 'fullscreenElement', {
  28. get() { return null },
  29. configurable: true,
  30. })
  31. document.dispatchEvent(new Event('fullscreenchange'))
  32. }
  33. })()