Zenqus: Disqus Comments on YouTube

Uncensored Disqus comments on YouTube!

当前为 2021-10-30 提交的版本,查看 最新版本

// ==UserScript==
// @name         Zenqus: Disqus Comments on YouTube
// @namespace    https://naeembolchhi.github.io/
// @description  Uncensored Disqus comments on YouTube!
// @version      1.3
// @author       NaeemBolchhi
// @license      GPL
// @icon         
// @include      https://www.youtube.com/watch*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    if (window.top === window.self) {
        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);
        }

        addGlobalStyle('.zbtn {position: fixed;bottom: 0;left: 0;height: 40px;width: 40px;text-align: center;font-size: 12px;line-height: 40px;background-color: #f118;z-index: 999999999;cursor: pointer;}.zbtn2,.zbtn:hover {background-color: #f11f;color: #fff;}.zenqus {position: fixed;bottom: 39px;left: 0;height: 40%;max-height: 290px;width: 100%;background-color: #111;overflow-y: scroll;z-index: 777777777;box-shadow: 0px -5px 20px 5px rgba(0,0,0,0.4);}.zstatus {position: fixed;bottom: 0;left: 0;height: 40px;width: 100%;text-align: left;line-height: 40px;background-color: #000;color: #eee;font-size: 12px;z-index: 888888888;}#disqus_thread {padding: 20px 40px 20px 40px;}')

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

        addGlobalScript('function zenqusBox() {var x = document.getElementById("zbtn");var y = document.getElementById("zenqus");var z = document.getElementById("zstatus");if (y.style.display === "none") {x.setAttribute("class","zbtn zbtn2");y.style.display = "block";z.style.display = "block";} else {x.setAttribute("class","zbtn");y.style.display = "none";z.style.display = "none";}}')

        var body, zbtn, zenqus, zstatus;
        body = document.getElementsByTagName('body')[0];
        if (!body) { return; }
        zbtn = document.createElement('div');
        zbtn.setAttribute('class',"zbtn");
        zbtn.setAttribute('id',"zbtn");
        zbtn.setAttribute('onclick',"zenqusBox()");
        zbtn.innerText = 'Z';
        body.appendChild(zbtn);
        zenqus = document.createElement('div');
        zenqus.setAttribute('class',"zenqus");
        zenqus.setAttribute('id',"zenqus");
        zenqus.setAttribute('style',"display:none;");
        body.appendChild(zenqus);
        zstatus = document.createElement('div');
        zstatus.setAttribute('class',"zstatus");
        zstatus.setAttribute('id',"zstatus");
        zstatus.setAttribute('style',"display:none;");
        zstatus.innerHTML = '<span style="margin-left: 55px;">Zenqus: Disqus Comments on YouTube</span>';
        body.appendChild(zstatus);

        function addDisqusScript(javascript) {
            var zenqus, script, noscript, div;
            zenqus = document.getElementById('zenqus');
            script = document.createElement('script');
            noscript = document.createElement('noscript');
            div = document.createElement('div');
            script.type = 'text/javascript';
            script.innerHTML = javascript;
            noscript.innerHTML = 'Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus</a>.';
            div.id = 'disqus_thread';
            zenqus.appendChild(div);
            zenqus.appendChild(script);
            zenqus.appendChild(noscript);
        }

        addDisqusScript("var disqus_config = function () {this.page.url = location.href;this.page.identifier = location.hash;};(function() {var d = document, s = d.createElement('script');s.src = 'https://zenqus.disqus.com/embed.js';s.setAttribute('data-timestamp', +new Date());(d.head || d.body).appendChild(s);})();")
    }

})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址