幻彩画笔newbing辅助脚本

幻彩画笔newbing辅助脚本,按tab键重置输入框,按ctrl键重置对话。

// ==UserScript==
// @name         幻彩画笔newbing辅助脚本
// @namespace    plusv
// @version      1.1
// @description  幻彩画笔newbing辅助脚本,按tab键重置输入框,按ctrl键重置对话。
// @match        https://visionarybrush.com/aichat/newbing
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    // Get the elements we need
    var textarea = document.getElementById("prompt"); // The textarea for typing questions
    var reset = document.getElementById("empty"); // The button for resetting the conversation

    // Add a keydown event listener to the document
    document.addEventListener("keydown", function(event) {
        // If the tab key is pressed
        if (event.key === "Tab") {
            // Prevent the default behavior of tab key
            event.preventDefault();
            // Focus on the textarea
            textarea.focus();
            // Select all the text in the textarea
            textarea.select();
            // Delete the selected text
            document.execCommand("delete");
        }
        // If the ctrl key is pressed
        if (event.key === "Control") {
            // Click on the reset button
            reset.click();
        }
    });
})();