Chat Full Profile Linker *OLD*

Opens a user's full profile by right-clicking on their name

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name           Chat Full Profile Linker *OLD*
// @namespace      tag://kongregate
// @description    Opens a user's full profile by right-clicking on their name
// @include        http://www.kongregate.com/games/*
// @author         MrSpontaneous
// @version        1.2
// @date           01/05/2010
// ==/UserScript==
// You cannot modify or redistribute this script without permission.

// Updated 03/22/2011 - added support for Firefox 4
// Updated 01/05/2010 - added support for the new version of Ventero's framework.

var dom = (typeof unsafeWindow === "undefined"?window:unsafeWindow);


function init_fullprofile(){
	CDialogue = dom.ChatDialogue;
	if (CDialogue){
		CDialogue.prototype = dom.CDprototype||dom.ChatDialogue.prototype;
		CDialogue.prototype.base_initialize = CDialogue.prototype.initialize;
		CDialogue.prototype.initialize = function(parent_node, onInputFunction, holodeck, user_manager) {
			this.base_initialize(parent_node, onInputFunction, holodeck, user_manager);
			var mwn = this._message_window_node.wrappedJSObject || this._message_window_node;
			mwn.observe('contextmenu',
				function(event) {
					if (event.target) { 
						var username = event.target.getAttribute('username');
						if(username){
							event.preventDefault();
							window.open('http://www.kongregate.com/accounts/'+username,'_blank');
						}
					}
				}
			);
		};
	}
}

function check(){
	var injectScript = dom.injectScript||(document.getElementById("injectScriptDiv")?document.getElementById("injectScriptDiv").onclick():0);
	if(dom.injectScript){
		dom.injectScript(init_fullprofile, 1000);
	} else if(!dom._promptedFramework && !/Chrome/i.test(navigator.appVersion)){
		if(confirm("You don't have the latest version of the framework-script!\n" + 
		           "Please install it, otherwise the scripts won't work.\n" +
		           "Clicking ok will open a new tab where you can install the script"))
			window.open("http://userscripts.org/scripts/show/54245", "_blank");
		dom._promptedFramework = true;
	}
}


setTimeout(check, 0);