Absolute Enable Right Click & Copy

Force Enable Right Click & Copy & Highlight

Tính đến 15-05-2017. Xem phiên bản mới nhất.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

Bạn sẽ cần cài đặt một tiện ích mở rộng như Tampermonkey hoặc Violentmonkey để cài đặt kịch bản này.

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.

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

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          Absolute Enable Right Click & Copy
// @namespace     Absolute Right Click
// @description   Force Enable Right Click & Copy & Highlight
// @shortcutKeys  [Ctrl + `] Activate Absolute Right Click Mode To Force Remove Any Type Of Protection
// @author        Absolute
// @version       1.4.3
// @include       *://*
// @icon          https://image.ibb.co/jXPFd5/cursor_128.png
// @homepageURL   https://greatest.deepsurf.us/en/scripts/23772
// @compatible    Chrome Google Chrome + Tampermonkey
// @license       BSD
// @copyright     Absolute, All Right Reserved (2016-Oct-06)
// @Exclude       /.*.(www.google.[^]|docs.google.[^]|www.bing.com|www.youtube.com|www.facebook.com|www.instagram.com|twitter.com).*/

// ==/UserScript==

    (function GetSelection () {
		var Style  = document.createElement('style');
		Style.type = 'text/css';
 		var TextNode = '*{user-select:text!important; -webkit-user-select:text!important;}';
      	if (Style.styleSheet) Style.styleSheet.cssText = TextNode;
 		else Style.appendChild(document.createTextNode(TextNode));
  		document.getElementsByTagName('head')[0].appendChild(Style);
        })();

    (function SetEvents () {
		var events = ['copy','cut','paste','select','selectstart'];
        for (var i = 0; i < events.length; i++)
		document.addEventListener(events[i],function(e){e.stopPropagation();},true);
        })();

    (function RestoreEvents () {
		var n = null;
		var d = document;
		var b = document.body;
		var SetEvents = [d.oncontextmenu=n,d.onselectstart=n,d.ondragstart=n,d.onmousedown=n];
		var GetEvents = [b.oncontextmenu=n,b.onselectstart=n,b.ondragstart=n,b.onmousedown=n,b.oncut=n,b.oncopy=n,b.onpaste=n];
		})();

    (function RightClickButton () {
		setTimeout(function() {
		document.oncontextmenu = null;
		},2000);
    function EventsCall (callback) {
        this.events = ['DOMAttrModified','DOMNodeInserted','DOMNodeRemoved','DOMCharacterDataModified','DOMSubtreeModified'];
        this.bind();
		}
    EventsCall.prototype.bind = function () {
        this.events.forEach(function (event) {
        document.addEventListener(event, this, true);
		}.bind(this));
        };
    EventsCall.prototype.handleEvent = function () {
        this.isCalled = true;
        };
    EventsCall.prototype.unbind = function () {
        this.events.forEach(function (event) {
        }.bind(this));
        };
    function EventHandler (event) {
        this.event = event;
        this.contextmenuEvent = this.createEvent(this.event.type);
        }
    EventHandler.prototype.createEvent = function (type) {
		var target = this.event.target;
		var event = target.ownerDocument.createEvent('MouseEvents');
		event.initMouseEvent(type, this.event.bubbles, this.event.cancelable,
        target.ownerDocument.defaultView, this.event.detail,
   	    this.event.screenX, this.event.screenY, this.event.clientX, this.event.clientY,
        this.event.ctrlKey, this.event.altKey, this.event.shiftKey, this.event.metaKey,
        this.event.button, this.event.relatedTarget);
		return event;
        };
    EventHandler.prototype.fire = function () {
        var target = this.event.target;
        var contextmenuHandler = function (event) {
        event.preventDefault();
        }.bind(this);
        target.dispatchEvent(this.contextmenuEvent);
        this.isCanceled = this.contextmenuEvent.defaultPrevented;
        };
        window.addEventListener('contextmenu', handleEvent, true);
    function handleEvent (event) {
		event.stopPropagation();
        event.stopImmediatePropagation();
        var handler = new EventHandler(event);
		window.removeEventListener(event.type, handleEvent, true);
    var EventsCallBback = new EventsCall(function () {
		});
        handler.fire();
        window.addEventListener(event.type, handleEvent, true);
        if (handler.isCanceled && (EventsCallBback.isCalled))
        event.preventDefault();
	    }})();

    (function IncludesSites () {
		var Sites_List = ['','',''];
		var Check = window.location.href;
		var Match = RegExp(Sites_List.join('|')).exec(Check);
		if (Match) { Absolute_Mod(); }
        })();

    function KeyPress (event) {
		if (event.ctrlKey && event.keyCode == 192) {
		if (confirm("Activate Absolute Right Click Mode!") === true)
        Absolute_Mod();
		}}
	    document.addEventListener("keydown", KeyPress);

    function Absolute_Mod () {
		var events = ['contextmenu','copy','cut','paste','mouseup','mousedown','keyup','keydown','drag','dragstart','select','selectstart'];
		for (var i = 0; i < events.length; i++) {
		document.addEventListener(events[i],function(e){e.stopPropagation();},true);
		}}