Avgle Helper

Help you watch videos smoothly at Avgle

Fra 17.01.2018. Se den seneste versjonen.

// ==UserScript==
// @name         Avgle Helper
// @namespace    https://avgle.com
// @version      1.3
// @description  Help you watch videos smoothly at Avgle
// @author       Neal
// @match        https://avgle.com/video/*
// @grant        none
// ==/UserScript==

function AddGlobalStyle(css) {
    var head, style;
    head = document.getElementsByTagName('head')[0];
    if (!head) return;
    style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = css;
    head.appendChild(style);
}

(function() {
    'use strict';

    const embed = document.getElementsByTagName('head')[0].innerHTML.match('https://avgle.com/embed/[^"]+')[0];
    const body = document.getElementsByTagName('body')[0]; body.style = 'background: black; margin: 0 auto';
    body.innerHTML = '<iframe width="1280" height="640" src="' + embed + '" frameborder="0" allowfullscreen></iframe>';

    AddGlobalStyle('.top-nav {position: absolute}');
    AddGlobalStyle('.navbar-fixed-top {position: absolute}');
    AddGlobalStyle('.col-md-4 {display: none}');
    AddGlobalStyle('.col-lg-8 {width: 100%}');
    AddGlobalStyle('#aoverlay {display:none}');
    AddGlobalStyle('#player_3x2_container {display:none}');
})();