GkPlugins Helper

This userscript assists all sites use plugins of GkPlugins in fetching data links. Mainly used as an alternative to the Java option currently provided.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         GkPlugins Helper
// @namespace    http://gkplugins.com/
// @version      0.1
// @description  This userscript assists all sites use plugins of GkPlugins in fetching data links. Mainly used as an alternative to the Java option currently provided.
// @icon         http://gkplugins.com/extensions/userscript/icon128.png
// @icon64       http://gkplugins.com/extensions/userscript/icon64.png
// @homepage     http://gkplugins.com/extensions/
// @author       GkPlugins
// @match        https://*/*
// @match        http://*/*
// @grant        GM_xmlhttpRequest
// @run-at       document-start
// ==/UserScript==

function checkReq(){
	var list = document.getElementById("gkpluginsExtListReq");
	if(list==null){
		return;
	}
	list.title = "ready";
	if(list.childNodes.length>0){
		var curReq = list.firstChild;
		if(typeof curReq.innerHTML=="undefined"){
			list.removeChild(curReq);
			return;
		}
		var obj = JSON.parse(atob(curReq.innerHTML));
		obj.onload = obj.onerror = obj.onabor = function(response){
			var txtout = document.createElement("textarea");
			txtout.id = obj.extreqid;
			txtout.style.display = "none";
			var Hfres = response.status+" "+response.statusText+"\r\n"+response.responseHeaders;
			if(response.finalUrl){
				Hfres += "FinalLocation: "+response.finalUrl+"\r\n";
			}
			if(obj.returndtaescape){
				txtout.value = escape(Hfres+"\r\n"+response.responseText);
			}else if(obj.returndtab64){
				txtout.value = btoa(Hfres+"\r\n"+response.responseText);
			}else{
				txtout.value = Hfres+"\r\n"+response.responseText;
			}
			document.body.appendChild(txtout);
		};
		GM_xmlhttpRequest(obj);
		list.removeChild(curReq);
	}
}
setInterval(checkReq,100);