Simple Redirection Buttons for Pahe

Simplify link jumping on pahe websites.

目前為 2022-04-14 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Simple Redirection Buttons for Pahe
// @namespace    https://naeembolchhi.github.io/
// @version      0.52
// @description  Simplify link jumping on pahe websites.
// @author       NaeemBolchhi
// @match        https://intercelestial.com/*
// @match        https://linegee.net/*
// @license      GPL-3.0-or-later
// @icon         https://pahe.li/wp-content/uploads/2017/12/favicon.ico
// @run-at       document-idle
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    function addStyle(css) {
        var head, style;
        head = document.querySelector('head');
        if (!head) {
            window.location.reload();
        }
        style = document.createElement('style');
        style.innerHTML = css;
        head.appendChild(style);
    }

    if (window.location.hostname == "linegee.net") {
        addStyle(`.btn.btn-primary.btn-xs {
                    position: fixed;
                    top: 0;
                    left: 0;
                    height: 100%;
                    width: 100%;
                    z-index: 99999999999 !important;
                    opacity: 1 !important;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    font-size: 4rem;
                    border-radius: 0;
                  }
                  #backdrop {
                    position: fixed;
                    top: 0;
                    left: 0;
                    height: 100%;
                    width: 100%;
                    z-index: 999999999 !important;
                    background: black;
                    opacity: 1;
                  }
                  * {
                    overflow: hidden;
                  }`);
    } else if (window.location.hostname == "intercelestial.com") {
        addStyle(`.qc-cmp2-persistent-link {
                    z-index: 0;
                  }
                  #qc-cmp2-container {
                    display: none;
                  }
                  div.wait > center > img {
                    position: fixed;
                    left: 0;
                    top: 0;
                    height: 100%;
                    width: 100%;
                    z-index: 99999999999 !important;
                    background: green;
                    opacity: 1 !important;
                  }
                  #generater > img {
                    display: none;
                  }
                  #generater {
                    position: fixed;
                    height: 100%;
                    width: 50%;
                    z-index: 99999999999 !important;
                    background: red;
                    opacity: 1 !important;
                  }
                  #showlink {
                    position: fixed;
                    height: 100%;
                    width: 50%;
                    z-index: 99999999999 !important;
                    background: blue;
                    opacity: 1 !important;
                  }
                  @media only screen and (orientation: landscape) {
                    #generater {
                      left: 0;
                    }
                    #showlink {
                      right: 0;
                    }
                    #generater, #showlink {
                      top: 0;
                      height: 100%;
                      width: 50%;
                    }
                  }
                  @media only screen and (orientation: portrait) {
                    #generater {
                      top: 0;
                    }
                    #showlink {
                      bottom: 0;
                    }
                    #generater, #showlink {
                      left: 0;
                      height: 50%;
                      width: 100%;
                    }
                  }
                  #backdrop {
                    position: fixed;
                    top: 0;
                    left: 0;
                    height: 100%;
                    width: 100%;
                    z-index: 999999999 !important;
                    background: black;
                    opacity: 1;
                  }
                  * {
                    overflow: hidden;
                  }`);
    }

    const makeZERO = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prY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        document.querySelector('div.wait center img').src = makeZERO;
    } catch {}
    try {
        document.querySelector('#showlink').src = makeZERO;
    } catch {}
    try {
        var body, element;
        body = document.querySelector('body');
        if (!body) {
            window.location.reload();
        }
        element = document.createElement('div');
        element.id = "backdrop";
        body.appendChild(element);
    } catch {}

})();