// ==UserScript== // @name 拒绝二维码登录 // @namespace NoQRCodeLogin // @version 1.0.5 // @description QQ、支付宝、淘宝、京东、百度云盘等网站默认使用账号密码登录,不出现二维码登录界面,原版出自https://greasyfork.org/zh-CN/scripts/27183,采用jQuery选择器重写,有需求或问题请反馈。 // @author Eva // @match *://login.taobao.com/* // @match *://passport.jd.com/* // @match *://*.baidu.com/* // @match *://passport.suning.com/* // @match *://*.zhihu.com/* // @match *://*.alipay.com/* // @match *://*.qq.com/* // @grant unsafeWindow // @require https://code.jquery.com/jquery-latest.js // @run-at document-end // @downloadURL none // ==/UserScript== (function() { //淘宝 if (isURL("login.taobao.com")) { var auto = setInterval(function() { if ($('#J_StaticForm').css('display') === 'none') { $('#J_Quick2Static').click(); clearInterval(auto); } }, 50); return; } //京东 if (isURL("passport.jd.com")) { var auto = setInterval(function() { if ($('.login-box').css('display') === 'none') { $('.login-tab-r').click(); clearInterval(auto); } }, 50); return; } //百度 if (isURL("baidu.com")) { var auto = setInterval(function() { var yunbtn = $('#TANGRAM__PSP_4__footerULoginBtn'); var indexBtn = $('#TANGRAM__PSP_10__footerULoginBtn'); if (yunbtn.length > 0) { yunbtn[0].click(); clearInterval(auto); } if (indexBtn.length > 0) { indexBtn[0].click(); clearInterval(auto); } }, 50); return; } //苏宁 if (isURL("passport.suning.com")) { var auto = setInterval(function() { if ($('.pc-login').css('display') === 'none') { $('.tab-item')[1].click(); clearInterval(auto); } }, 50); return; } //知乎 if (isURL("zhihu.com")) { var loginDiv = $('.Login-content'); var auto = setInterval(function() { if (loginDiv.length == 0) { $('.SignContainer-switch').children("span").click(); clearInterval(auto); } }, 50); return; } //支付宝 if (isURL("alipay.com")) { var auto = setInterval(function() { var changeTabs = $('#J-loginMethod-tabs li'); var qrCode = $('#J-qrcode'); var ssoLogin = $('#J-ssoLogin'); var loginForm = $('#J-login'); var loginFormMethod = $('#J-loginFormMethod'); var popbox = $('#J_popbox'); if(popbox.hasClass('stat-login')){ var iframe = $('#J_loginIframe'); if(iframe) { var contentWindow = iframe[0].contentWindow; if(contentWindow) { var loginMethod = contentWindow.document.getElementById('J-loginFormMethod'); if(loginMethod) { contentWindow.document.getElementById('J-qrcode-target').click(); clearInterval(auto); } } } } if (changeTabs.length >= 2) { changeTabs.each(function(index,element){ var self = $(this); if((self.attr('data-status') === 'show_login') && (!self.hasClass("active"))){ loginFormMethod.val(''); qrCode.addClass('fn-hide'); if (window.light && window.light.page && window.light.page.products && window.light.page.products.barcode) { window.light.page.products.barcode.onready(function () { this.stop(); }); } if (ssoLogin.attr('data-hide') === 'false' && ssoLogin.attr('data-state') === 'finished') { ssoLogin.removeClass('fn-hide'); } else { loginForm.removeClass('fn-hide'); } self.addClass("active"); self.siblings().removeClass('active'); clearInterval(auto); } }); } }, 50); } //QQ if (isURL('xui.ptlogin2.qq.com') || isURL('ssl.xui.ptlogin2.qq.com') || isURL('ui.ptlogin2.qq.com')) { var auto = setInterval(function() { if ($('.onekey_logo').length == 1 || $('.face').length == 1) { $('#switcher_plogin')[0].click(); $('#qrlogin_img').onload = function() { clearInterval(auto); }; } }, 50); return; } //判断网址 function isURL(x){ return window.location.href.indexOf(x) != -1; } })();