AutoQQLogin

用于网站自动QQ登录

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name		 AutoQQLogin
// @name:zh-CN   自动QQ登录
// @namespace    AutoQQLogin
// @version      1.1.0
// @description  用于网站自动QQ登录
// @include      http*://xui.ptlogin2.qq.com/cgi-bin/xlogin*
// @run-at 		document-end
// @author       wycaca
// @copyright 	2020+, wycaca
// ==/UserScript==

var now = 1;
var time = 5;
var a,b;
(function() {
    a = window.setInterval(login, 1000);
    b = window.setInterval(timeCheck, 1000);
})();

function login() {
    now++;
    var qqNum = document.getElementById("qlogin_list").childNodes[1].getAttribute("uin");
    if (qqNum.length > 3) {
        console.log("QQ: " + qqNum);
        // 判断是否为手机登录
        if (document.getElementsByClassName("onekey_logo").length == 0){
            var QQNum = document.getElementById("qlogin_list").childNodes[1].getAttribute("uin");
            console.log("QQNumElem: " + document.getElementById("img_out_" + QQNum));
            document.getElementById("img_out_" + QQNum).click();
        } else {
            console.log("Mobile QQ Online");
        }
    }
}

function timeCheck() {
    console.log("now: " + now);
    if(now >= time){
        window.clearInterval(a);
        window.clearInterval(b);
    }
    document.getElementById("switcher_plogin").click();
}