Greasy Fork is available in English.

初音的青葱Onedrive自动填充密码并点击

仅适用于特定网站

您查看的为 2020-06-19 11:23:36 UTC 提交的版本。查看 最新版本

// ==UserScript==
// @name         初音的青葱Onedrive自动填充密码并点击
// @namespace    http://tampermonkey.net/
// @version      1.0.0
// @description  仅适用于特定网站
// @author       aotmd
// @match        https://mkgal-my.sharepoint.com/*
// @match        https://www.mkgal.com/*
// @icon         https://www.mkgal.com/static/images/login.jpg
// @grant        none
// ==/UserScript==

(function() {
	var setting={
		//取不到值的默认密码
		"默认密码":"MKFX",
	};
	window.onload = function() {
		function getQueryString(name) {
		var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
		var r = decodeURI(window.location.search).substr(1).match(reg);
		if (r != null) return (r[2]);
		return null;
	}
		var url = window.location.href;
		var str = /https:\/\/www\.mkgal\.com\/.+/i;
		var str2 = /https:\/\/mkgal-my\.sharepoint\.com\/.+/i;
		if (str.test(url)) {
			var a = document.getElementsByClassName("pan")[0];
			a.getElementsByTagName("a")[0].href += "&password=" + a.getElementsByTagName("span")[0].innerText;
		} else if (str2.test(url)) {
			if (getQueryString('password')==null) {
				document.getElementById("txtPassword").value = setting.默认密码;
			} else {
				document.getElementById("txtPassword").value = getQueryString('password');
			}
			document.getElementById("btnSubmitPassword").click();
		}
	};
})();