// ==UserScript== // @name Paste to Grok Textarea // @description Paste text into Grok textarea from main page // @match *://grok.com/* // @version 0.0.1.20250516072348 // @namespace https://greasyfork.org/users/1435046 // @downloadURL none // ==/UserScript== (function () { 'use strict'; // Listen for messages from parent window.addEventListener("message", event => { const data = event.data; if (typeof data === "string" && data.trim()) { // Try to find the Grok textarea const textarea = document.querySelector('textarea[aria-label="Ask Grok anything"]'); if (textarea) { textarea.focus(); textarea.value = data; // Dispatch input event so React sees the change textarea.dispatchEvent(new Event("input", { bubbles: true })); } } }); })();