Skip to content

Instantly share code, notes, and snippets.

@Vizards
Created February 8, 2017 16:35
Show Gist options
  • Save Vizards/a30e58d4c84041a57ab1761ce8ebb738 to your computer and use it in GitHub Desktop.
Save Vizards/a30e58d4c84041a57ab1761ce8ebb738 to your computer and use it in GitHub Desktop.
Disable QR Code
// ==UserScript==
// @name 拒绝二维码登录(淘宝、京东等网站默认出现账号密码登录界面)
// @namespace undefined
// @version 0.1
// @description 淘宝、京东、阿里云等网站默认使用账号密码登录,不出现二维码登录界面
// @author Vizards
// @match *://login.taobao.com/*
// @match *://login.1688.com/*
// @match *://account.aliyun.com/*
// @match *://passport.jd.com/*
// @match *://weibo.com/*
// @match *://login.tmall.com/*
// @grant none
// ==/UserScript==
/**
* login.taobao.com/*
* login.1688.com/*
* login.tmall.com/*
*/
window.onload = setTimeout(function() {
if (location.hostname === 'login.taobao.com' || location.hostname === 'login.1688.com') {
if (document.defaultView.getComputedStyle(document.getElementsByClassName('static-form')[0]).display === 'none') {
document.getElementById('J_Quick2Static').click();
}
}
// 等待1s是为了解决淘宝登录页的bug...我也不想...
},1000);
// passport.jd.com/*
window.onload = function() {
if (location.hostname === 'passport.jd.com') {
if (document.getElementsByClassName('login-box')[0].style.display === 'none') {
document.getElementsByClassName('login-tab-r')[0].click();
}
}
};
// account.aliyun.com/*
if (location.hostname === 'account.aliyun.com') {
miniLoginEmbedder.init({
targetId: 'alibaba-login-iframe',
appName: 'aliyun',
appEntrance: 'aliyun',
iframeUrl: 'https://passport.alibaba.com/mini_login.htm',
lang: 'zh_CN',
notLoadSsoView: '',
notKeepLogin: 'true',
loginId: '',
iframeHeight: '305px',
queryStr: '&regUrl=https%3A%2F%2Faccount.aliyun.com%2Fregister%2Fregister.htm%3Foauth_callback%3Dhttps%253A%252F%252Fcn.aliyun.com%252F&qrCodeFirst=false'
});
window.onload = function () {
document.getElementById('alibaba-login-iframe').getElementsByTagName('iframe')[0].style.display = 'none';
document.getElementById('alibaba-login-iframe').getElementsByTagName('iframe')[1].height = '320';
document.getElementsByClassName('agreement')[0].style.bottom = '-25px';
};
}
// weibo.com/*
if (location.hostname === 'weibo.com') {
if (document.getElementsByClassName('W_login_form')[0].style.display === 'none') {
document.getElementsByClassName('W_fb')[0].click();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment