Website to editor

Easy to edit anything in website.

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

You will need to install an extension such as Tampermonkey to install this 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         Website to editor
// @namespace    http://tampermonkey.net/
// @icon         https://scontent.fdad1-1.fna.fbcdn.net/v/t1.0-9/10346186_1645759148993427_6744387242769246115_n.jpg?_nc_cat=102&_nc_ht=scontent.fdad1-1.fna&oh=b460d464946fcbcb92d4783d903412ef&oe=5C8F4A97
// @version      0.1
// @description  Easy to edit anything in website.
// @author       HuuKhanh
// @include http://*/*
// @include https://*/*
// @grant        none
// ==/UserScript==

/*
- Enter rate to search bar then press '`' to change raterate
*/
(function() {
    'use strict';
    document.getElementsByTagName('html')[0].setAttribute("contenteditable", "false");
    document.getElementsByTagName('html')[0].addEventListener("keydown", function(event) {
	var x = event.which || event.keyCode;
    var isShiftKey = event.shiftKey;
	if(x == 69) {
		var isEnable = document.getElementsByTagName('html')[0].getAttribute("contenteditable");
        console.log(isEnable);
        console.log(isShiftKey);
        if(isEnable === 'false' && isShiftKey) {
            document.getElementsByTagName('html')[0].setAttribute("contenteditable", "true");
        }
		else {
            document.getElementsByTagName('html')[0].setAttribute("contenteditable", "false");
        }
	}
}) ;
})();