ChatGPT Search Shortcut

Search ChatGPT From Your Address Bar Without Having To Go To The Website

Versão de: 27/04/2023. Veja: a última versão.

// ==UserScript==
// @name         ChatGPT Search Shortcut
// @namespace    https://greasyforks.org/en/users/943407-webchantment
// @version      1.1
// @description  Search ChatGPT From Your Address Bar Without Having To Go To The Website
// @author       Webchantment
// @match        https://chat.openai.com/?search=*
// @grant        none
// ==/UserScript==

(async () => {

	const timeout = 500; //milliseconds

	const urlParams = new URLSearchParams(window.location.search);
	const searchInput = urlParams.get("search");

	setTimeout(() => {

		const textarea = document.querySelector("form > * textarea");
		const button = document.querySelector("form > * button");

		if (searchInput && textarea && button) {
			textarea.value = searchInput;
			button.disabled = false;
			button.click();
		}

	}, timeout);

})();
长期地址
遇到问题?请前往 GitHub 提 Issues。