您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
1. Enlarges the chat input box. 2. Automatically moves the focus to the chat input box when the user types. 3. Sets the chatInput as the focus when the page is loaded.
当前为
// ==UserScript== // @name Poe Optimize // @namespace http://tampermonkey.net/ // @version 0.3 // @description 1. Enlarges the chat input box. 2. Automatically moves the focus to the chat input box when the user types. 3. Sets the chatInput as the focus when the page is loaded. // @author Cursor & Mason // @match *://poe.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=poe.com // @grant none // ==/UserScript== (function () { 'use strict'; // Get all sections with class PageWithSidebarLayout_mainSection__i1yOg const sections = document.querySelectorAll('[class^="PageWithSidebarLayout_mainSection"]'); console.log(sections); // 打印检索到的sections以供调试 // Loop through each section and remove the width and max-width properties sections.forEach(section => { console.log('Processing element with class:', section.className); // 强制设置,不允许后续有修改 section.style.setProperty('width', 'unset', 'important'); section.style.setProperty('max-width', 'unset', 'important'); }); // Find the textarea element with class starting with ChatMessageInputView_textInput const chatInput = document.querySelector('textarea[class^="ChatMessageInputView_textInput"]'); console.log(chatInput); // 打印检索到的chatInput以供调试 // Add an event listener to the document that listens for user input document.addEventListener('keypress', event => { // If the target of the input event is the chatInput element and it does not have focus, set focus to it if (!chatInput.matches(':focus')) { chatInput.focus(); } }); // Set the chatInput as the focus when the page is loaded window.addEventListener('focus', () => { chatInput.focus(); }); })();