Skip to content

Instantly share code, notes, and snippets.

@mmyjona
Created March 30, 2023 05:25
Show Gist options
  • Save mmyjona/3632a51ce56bc8b0a590eba904a6101c to your computer and use it in GitHub Desktop.
Save mmyjona/3632a51ce56bc8b0a590eba904a6101c to your computer and use it in GitHub Desktop.
Bing chat auto fill textarea with query string
// ==UserScript==
// @name Bing Chat Auto Input
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.bing.com/search?*showconv=1*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==
(function() {
'use strict';
console.log("PowerToys Run ChatGPT Helper script loaded");
const searchParams = new URLSearchParams(window.location.search);
const prompt = searchParams.get("ptq");
if (prompt) {
setTimeout(() => {
const textArea = document.querySelector('.cib-serp-main').shadowRoot.querySelector("#cib-action-bar-main").shadowRoot.querySelector("#searchbox");
if (!textArea) {
console.error("Cannot find required elements");
}
textArea.value = prompt;
}, 3000);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment