HasYoutube

Bu eklenti youtube için yazılmış oynatıcı içerir.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

You will need to install an extension such as Tampermonkey to install this script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         HasYoutube
// @namespace    https://hascoding.com
// @version      2024-01-02@06
// @description  Bu eklenti youtube için yazılmış oynatıcı içerir.
// @author       HASANERYILMAZ
// @match        https://www.youtube.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @grant        none
// @license      HasCoding
// ==/UserScript==

(function() {
    'use strict';

    var v;

    function checkurl () {
        var url = window.location.href;
        var parts = url.split("?");
        var params = parts[1].split("&");
        for (var i = 0; i < params.length; i++) {
            var pair = params[i].split("=");
            if (pair[0] == "v") {
                v = pair[1];
            }
            break;
        }
    }

    function replaceDivWithIframe() {
        var div = document.getElementById("player");
        div.innerHTML = "";
        var iframe = document.createElement("iframe");
        iframe.id = "HasPlayer";
        iframe.width = "100%";
        iframe.height = "600";
        iframe.src = "https://www.youtube.com/embed/"+v+"?autoplay=1";
        iframe.style.border = "none";
        div.appendChild(iframe);
    }

    function checkV() {
        var url = window.location.href;
        var parts = url.split("?");
        var params = parts[1].split("&");
        var yeniv;
        for (var i = 0; i < params.length; i++) {
            var pair = params[i].split("=");
            if (pair[0] == "v") {
                yeniv = pair[1];
            }
        }
        if (yeniv != v) {
            v = yeniv;
            replaceDivWithIframe();
        }
    }
    setInterval(checkV, 10000);

})();