A Chrome extension that hides all YouTube UI except for your video
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 2.3KB

1
  1. !function(e){var n={};function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:o})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(t.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var r in e)t.d(o,r,function(n){return e[n]}.bind(null,r));return o},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=1)}([function(e,n,t){},function(e,n,t){"use strict";t.r(n);const o=e=>`\n <head>\n <title>Refined YouTube</title>\n <meta charset="utf8">\n </head>\n <body class="refined-youtube">\n <div id="refined-youtube-container">\n <iframe\n width="1280"\n height="720"\n src="https://www.youtube.com/embed/${e}"\n frameborder="0"\n allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"\n allowfullscreen\n ></iframe>\n </div>\n <a id="refined-youtube-close-button" href="https://www.youtube.com/watch?v=${e}">\n x\n </a>\n </body>\n`;t(0);window.onload=async()=>{const e=e=>document.querySelector(e),n=e=>{const n=window.location.search.substr(1).split("&").map(e=>e.split("=")).find(n=>n[0]===e);return n?n[1]:void 0},t=n=>e("html").innerHTML=n,r=n("v"),u=!!n("refined");if(void 0!==r)if(u)t(o(r));else{const n=document.createElement("div");n.innerHTML='\n <div id="refined-youtube-launch-container">\n <button id="refined-youtube-launch-button">\n View on Refined YouTube\n </button>\n <span id="refined-youtube-launch-close-button">\n x\n </span>\n </div>\n',document.body.append(n);const u=e("#refined-youtube-launch-button"),i=e("#refined-youtube-launch-close-button");u.addEventListener("click",()=>t(o(r))),i.addEventListener("click",()=>{const n=e("#refined-youtube-launch-container");n.style.opacity=0,setTimeout(()=>{n.remove()},1e3)})}}}]);