url2ss

解析独秀ssid

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         url2ss
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  解析独秀ssid
// @author       You
// @include        http://*.fazz.ntszzy.org:8070/*
// @include        https://*.duxiu.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=ntszzy.org
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';
    let hoverEle;
    document.addEventListener('mousemove', e=>{
        hoverEle = document.elementFromPoint(e.clientX, e.clientY)
    }
    , {
        passive: true
    })

    var clipboard = {
        data: '',
        intercept: false,
        hook: function(evt) {
            if (clipboard.intercept) {
                evt.preventDefault();
                evt.clipboardData.setData('text/plain', clipboard.data);
                alert(clipboard.data + ' copy success');
                clipboard.intercept = false;
                clipboard.data = '';
            }
        }
    };

    window.addEventListener('copy', clipboard.hook);

    function copy(textContent) {
        clipboard.data = textContent;

        if (window.clipboardData) {
            window.clipboardData.setData('Text', clipboard.data);
        } else {
            clipboard.intercept = true;
            document.execCommand('copy');
        }
    }

    document.addEventListener('keypress', function(e) {
        console.log(e);
        if (e.keyCode === 99) {
            const url = document.location.href + hoverEle.closest("a").getAttribute('href')
            console.log(url);
            const ss = new URL(url).searchParams.get('qwkey').substr(0, 8);
            console.log(ss);
            copy(ss)
        }
    })
    // Your code here...
}
)();