Avgle Helper

Help you watch videos smoothly

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         Avgle Helper
// @namespace    https://avgle.com
// @version      1.6
// @description  Help you watch videos smoothly
// @author       Neal
// @match        https://avgle.com/*
// @match        https://blank.org/*
// @grant        none
// @noframes
// ==/UserScript==

(() => {
    'use strict';

    function style(css) {
        const style = document.createElement('style');

        style.type = 'text/css';
        style.innerHTML = css;

        return style;
    }

    const href = document.location.href;
    const head = document.getElementsByTagName('head')[0];
    const body = document.getElementsByTagName('body')[0];

    if (href.match('https://avgle.com/video/')) {
        const embed = head.innerHTML.match('https://avgle.com/embed/[^"]+');
        window.location.href = 'https://blank.org/?' + embed;
    } else if (href.match('https://blank.org/')) {
        const embed = href.match('https://avgle.com/embed/[^"]+');

        body.style = 'background: black; padding: 0; text-align: center';
        body.innerHTML = '<iframe width="1280" height="640" src="' + embed + '" frameborder="0" allowfullscreen></iframe>';
    } else {
        head.appendChild(style('.top-nav {position: absolute}'));
        head.appendChild(style('.navbar-fixed-top {position: absolute}'));
    }
})();