Website to editor

Easy to edit anything in website.

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

You will need to install an extension such as Tampermonkey to install this script.

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

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

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==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");
        }
	}
}) ;
})();