Disable artificial selections

Tries to prevent script-initiated selection tweaks.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name        Disable artificial selections
// @description Tries to prevent script-initiated selection tweaks.
// @namespace   http://eldar.cz/myf/
// @license     MIT
// @version     1.0.4
// @run-at      document-start
// @grant       none
// ==/UserScript==

Selection.prototype.addRange = function () {
	console.warn('This Selection method is deliberately disabled by user.');
}

HTMLTextAreaElement.prototype.select =
HTMLInputElement.prototype.select =
function(){
	console.warn('Forced artificial selection of',this,'value is deliberately disabled by user. Focusing instead.');
	this.focus();
}