您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Listens for postMessage events on playground.allenai.org, enters into chat input, and auto-submits
// ==UserScript== // @name AllenAI Auto-Submit Listener // @description Listens for postMessage events on playground.allenai.org, enters into chat input, and auto-submits // @match https://playground.allenai.org/* // @version 0.0.1.20250516101342 // @namespace https://gf.qytechs.cn/users/1435046 // ==/UserScript== (function() { 'use strict'; function setNativeValue(element, value) { const lastValue = element.value; element.value = value; const tracker = element._valueTracker; if (tracker) { tracker.setValue(lastValue); } element.dispatchEvent(new Event('input', { bubbles: true })); } window.addEventListener('message', event => { if (event.data?.type === 'newChatButtonClicked') { const newChatLink = document.querySelector('a[aria-label="Create a new thread"]'); if (newChatLink) { newChatLink.click(); } return; } if (event.data.type !== 'prompt' || event.data.content === 'recaptcha-setup') return; const message = event.data.content; // find the MUI/React textarea const textarea = document.querySelector( 'textarea[name="content"], textarea[aria-label="Message OLMo"]' ); if (!textarea) return; // inject into React state setNativeValue(textarea, message); // find and click the submit button const sendButton = document.querySelector('button[aria-label="Submit prompt"]'); if (sendButton) { sendButton.click(); } }); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址