Allow Copy and Contex Menu Continued

Allow Copy (include hot keys and some css) & Contex Menu

Version vom 20.09.2015. Aktuellste Version

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

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 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.

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

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	Allow Copy and Contex Menu Continued
// @version	3
// @author	Anonimous
// @namespace	https://greasyfork.org/en/users/16081-lolipop
// @description	Allow Copy (include hot keys and some css) & Contex Menu
// @include	*
// @license      GPL version 3 or any later version; www.gnu.org/licenses/gpl-3.0.en.html
// @grant	GM_addStyle
// @run-at	document-start
// ==/UserScript==

;(function(){

	/* handler names */
	var handlerNameArr = ['contextmenu', 'copy', 'cut', 'paste', 'mousedown', 'mouseup', 'beforeunload', 'beforeprint', 'keyup', 'keydown'];

	/* remove protection of window */
	var removeProtection = function removeProtectionName(protectedWindow) {

		/*
		 * document object in frames is same as window https://developer.mozilla.org/en-US/docs/Web/API/Window/frames
		 * frames == iframe + frame
		 */
	
		for(var i=0; i < handlerNameArr.length; i++){
			var handlerName = handlerNameArr[i];
			var handlerOnName = 'on' + handlerName;
			
			if(protectedWindow[handlerName])
				protectedWindow[handlerName] = null;
			protectedWindow.addEventListener(handlerName, function(e){ e.stopPropagation(); }, true);
		}

	};

	/* remove main window protection */
	removeProtection(window);

	/* remove frame window protection */
	var frameList = window.frames;

	for(var i = 0; i < frameList.length; i++) {
		try{
			removeProtection(frameList[i]);
		} catch(e){
		}
	}
	
	/* remove css protection */
	GM_addStyle('* { -moz-user-select: text !important; user-select: text !important; } ');
})();