🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

Greasy Fork is available in English.

📂 缓存分发状态(共享加速已生效)
🕒 页面同步时间:2025/12/28 05:41:59
🔄 下次更新时间:2025/12/28 06:41:59
手动刷新缓存

Ventero's Chat-scripts Framework *OLD*

Required by all of Ventero's Kongregate scripts

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.

(У мене вже є менеджер скриптів, дайте мені встановити його!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

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.

You will need to install an extension such as Stylus to install this style.

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

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

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

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

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

// ==UserScript==
// @name          Ventero's Chat-scripts Framework *OLD*
// @namespace     tag://kongregate
// @description   Required by all of Ventero's Kongregate scripts
// @include       http://www.kongregate.com/*
// @author        Ventero
// @version       1.9
// @date          05.04.2013
// require       http://kong.ventero.de/updates/54245.js
// @grant         unsafeWindow
// @license       MIT license
// ==/UserScript==

// Written by Ventero (http://www.kongregate.com/accounts/Ventero) 07/22/09
// Copyright (c) 2009-2012 Ventero, licensed under MIT/X11 license
// http://www.opensource.org/licenses/mit-license.php
var dom = (typeof unsafeWindow === "undefined"?window:unsafeWindow);
var ready = false;

// cross window communication
window.addEventListener("message", function onMessage(e) {
	if(e.data != "__scripts_ready" || e.origin != location.origin) return;

	ready = true;
	window.removeEventListener("message", onMessage);
}, false);

injectScript(function bootstrap(dom){
	var target = ("holodeck" in dom ? "holodeck:ready" : "dom:javascript_loaded");
	document.addEventListener("dataavailable", function listener(e) {
		if(e.eventName != target) return;

		ready = true;
		window.postMessage("__scripts_ready", location.origin);
		document.removeEventListener("dataavailable", listener);
	}, false);
}, 0, true);

function injectScript(fn, to, force){
	if(!ready && !force) {
		setTimeout(function(){injectScript(fn, to)}, 100);
		return;
	}
	try{
		var inject;
		if(force ||
			 /Chrome/i.test(navigator.appVersion) ||
			 typeof unsafeWindow === "undefined"){
			var script = document.createElement("script");
			var source = fn.toString();
			if(source[source.length - 1] == ";"){
				source = source.substring(0, source.length - 1);
			}

			script.type = "text/javascript";
			script.textContent = "//<![CDATA[\n" +
			                   "(" + source + ")(window);\n" +
			                   "//]]>";

			setTimeout(function(){document.body.appendChild(script)}, to);
		}else{
			setTimeout(function(){fn(unsafeWindow);}, to);
		}

	}catch(e){console.log("Framework script: " + e)};
}
dom.injectScript = injectScript;

function init_framework(){
	if(dom.holodeck){
		dom.CDprototype = dom.ChatDialogue.prototype;
		dom.CWprototype = dom.ChatWindow.prototoype;
		dom.CRprototype = dom.ChatRoom.prototype;
		dom.Holoprototype = dom.Holodeck.prototype;
	}

	addScript = document.createElement("script");
	addScript.innerHTML = "function ajax(a, b){new Ajax.Request(a,b)};\n";
	addScript.innerHTML+= "function wrap(a, b){return a.wrap(b)};\n";
	document.body.appendChild(addScript);
}

if(window.opera){
	if(window.localStorage){
		window.GM_setValue = function(a, b){
			localStorage.setItem(a, b);
		}
		window.GM_getValue = function(a, b){
			var ret = localStorage.getItem(a);
			return (ret == null?b:ret)
		}
		window.GM_deleteValue = function(a){
			localStorage.removeItem(a);
		}
	} else {
		window.GM_setValue = function(){};
		window.GM_getValue = function(){};
		window.GM_deleteValue = function(){};
	}
}else if(/Chrome/i.test(navigator.appVersion) || typeof unsafeWindow === "undefined"){
	var s = document.createElement("script");
	s.id = "injectScriptDiv";
	s.innerHTML = "dom = window;\n";
	s.innerHTML+= "if(typeof GM_setValue === 'undefined'){\n";
	s.innerHTML+= "	window.GM_setValue = function(a,b){localStorage.setItem(a,b)}\n";
	s.innerHTML+= "	window.GM_getValue = function(a,b){var r=localStorage.getItem(a);return (r==null?b:r)}\n";
	s.innerHTML+= "	window.GM_deleteValue = function(a){localStorage.removeItem(a)}\n";
	s.innerHTML+= "}";
	s.onclick = function(){return dom.injectScript};
	document.body.appendChild(s);
}

injectScript(init_framework, 0);