Content Editor

Press CTRL + SHIFT + E to enable editing mode, this will allow you to edit any text of a website. Press CTRL + SHIFT + E again to turn it off.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Content Editor
// @namespace    http://tampermonkey.net/
// @version      6.1
// @description  Press CTRL + SHIFT + E to enable editing mode, this will allow you to edit any text of a website. Press CTRL + SHIFT + E again to turn it off.
// @author       Aadoxide
// @match        *://*/*
// @icon         https://raw.githubusercontent.com/Aadoxide/pecnol/main/pencil.gif
// @license      WTFPL
// @grant        none
// ==/UserScript==

// i made this for my timepass just so you know.

(function() {
    'use strict';

    var notification = true; // optional
    let contentEditingEnabled = false;

    if (notification) {
        document.addEventListener('keydown', function(event) {
            if (event.ctrlKey && event.shiftKey && event.key === 'E') { // you can change the keybind if you want 👍
                event.preventDefault();
                contentEditingEnabled = !contentEditingEnabled;
                document.body.contentEditable = contentEditingEnabled;
                showNotification(`Editing Mode ${contentEditingEnabled ? 'Enabled' : 'Disabled'}`);
            }
        });
    }

    function showNotification(message) {
        const notificationElement = document.createElement('div');
        notificationElement.textContent = message;
        notificationElement.style.position = 'fixed';
        notificationElement.style.top = '10px';
        notificationElement.style.right = '10px';
        notificationElement.style.backgroundColor = 'rgba(0, 0, 0, 0.8)';
        notificationElement.style.color = 'white';
        notificationElement.style.padding = '10px';
        notificationElement.style.borderRadius = '5px';
        notificationElement.style.zIndex = '9999';

        document.body.appendChild(notificationElement);

        setTimeout(() => {
            document.body.removeChild(notificationElement);
        }, 2000); // duration of the notification (2 seconds)
    }
})();