Chat Full Profile Linker *OLD*

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

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

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

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 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);