XNXX Player Enlarger and Scroller

Enlarge player and scroll to it

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name             XNXX Player Enlarger and Scroller
// @namespace   [email protected]
// @description   Enlarge player and scroll to it
// @include          *://*xnxx*.*/*
// @version          1.01
// @grant              none
// ==/UserScript==

(function scrollXNXX() {

    // Page modification without CSS
    window.addEventListener("DOMContentLoaded", function() {
        // More tiles in pages that had side ads
        if (document.querySelector(".mozaique:not(.thumbs-4)")) {
            document.querySelector(".mozaique:not(.thumbs-4)").className = "mozaique thumbs-4";
        }
        // Scroll to center video
        if (document.querySelector("body.video-page")) {
            document.querySelector("body.video-page #content").className = "player-enlarged";

            function scrollthere() {
                var vid = document.querySelector("#video-content"),
                    vh = vid.offsetHeight,
                    vd = vid.offsetTop,
                    fh = window.innerHeight,
                    sc = vd-((fh-vh)/2)
                console.log(vd)
                scrollTo(0, sc)
            }// Now inject this function
            var script = document.createElement("script")
            script.setAttribute("type","text/javascript")
            script.innerHTML = scrollthere.toString() + "scrollthere();"
            script.id = ("scrollVid")
            document.head.appendChild(script)
            // Include button in right corner to center video on screen
            var node = document.createElement("div");
            node.setAttribute("style","position: fixed;" +
                                      "bottom: 0;" +
                                      "right: 128px;" +
                                      "cursor: pointer;" +
                                      "border: 1px solid #313131;" +
                                      "border-top-left-radius: 5px;" +
                                      "color: #286fff;" +
                                      "font-weight: 700;" +
                                      "background: #101010;" +
                                      "text-align: center;" +
                                      "font-size: 12px;" +
                                      "padding: 7px 15px;" +
                                      "z-index: 999999;");
            node.setAttribute("onclick", "scrollthere();");
            node.setAttribute("title", "Click here to centre video");
            node.innerHTML = "Centre";
            node.id = "scroll";
            document.body.appendChild(node);
        }
    });
}());