YouTube Mobile Fullscreen Fix for Kiwi Browser

-

  1. // ==UserScript==
  2. // @name:ko 키위브라우저 유튜브 풀스크린 잘림 개선
  3. // @name YouTube Mobile Fullscreen Fix for Kiwi Browser
  4.  
  5. // @description:ko -
  6. // @description -
  7.  
  8. // @namespace https://ndaesik.tistory.com/
  9. // @version 1.0
  10. // @author ndaesik
  11. // @icon https://t1.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=https://www.youtube.com
  12. // @match *://*.youtube.com/*
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. const FIREFOX_UA = 'Mozilla/5.0 (Windows Phone 10.0; Android 8.0.0; Microsoft; Lumia 950XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.75 Mobile Safari/537.36 Edge/15.15063';
  17. const setUserAgent = () => {
  18. if (window.location.hostname.includes('youtube.com')) {
  19. Object.defineProperty(navigator, 'userAgent', { get: () => FIREFOX_UA });
  20. Object.defineProperty(navigator, 'platform', { get: () => 'Windows Phone' });
  21. }
  22. };
  23. setUserAgent();
  24. new MutationObserver(setUserAgent).observe(document.documentElement, { childList: true, subtree: true });
  25. })();