Skip to content

Instantly share code, notes, and snippets.

@jamesreggio
Forked from radermacher/boost.js
Created August 26, 2023 17:42
Show Gist options
  • Save jamesreggio/0b5301f887819b0cf5f84a0d3cfcc057 to your computer and use it in GitHub Desktop.
Save jamesreggio/0b5301f887819b0cf5f84a0d3cfcc057 to your computer and use it in GitHub Desktop.
Arc ChatGPT Boost
// fork of https://gist.github.com/b-nnett/2749adb44566239e4c85ad1a8937c2bc
// origin by @B_nnett → https://twitter.com/joshm/status/1648346253355282432?s=20
/*
To set up this boost for chat.openai.com:
1) open Arc browser and login at chat.openai.com.
2) Head over to the + button in your sidebar and select New Boost.
Or hit ⌘ + T and type New Boost into your Command Bar.
3) Click the `Code` button.
4) Click the `JS` tab at the top.
5) Copy and paste code of this gist.
6) Click the `Back` button at the top left.
8) Click `My Boost` at the top.
9) Click `Rename This Boost...`.
10) Name this boost however you like, for example, `ChatGPT`.
11) Click "OK" to save the name.
12) Close the Boost window.
Congrats you created your (first) Boost!
Last step: Add ChatGPT to your configured search engines with URL `https://chat.openai.com/?question=%s`
How? Read my comment here:
https://gist.github.com/radermacher/8b8e98a01cd131257428075887f87492?permalink_comment_id=4545939#gistcomment-4545939
Want to know more about Boosts? Check out this article:
https://resources.arc.net/en/articles/6808613-boosts-customize-any-website
*/
// This will run in the background
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function fillQuery() {
let url = new URL(document.location);
let question = url.searchParams.get('question');
if(!question) {
return;
}
await sleep(1000); // Pause for 1 second
let input = document.getElementById("prompt-textarea");
input.value = question;
input.dispatchEvent(new Event('input', {bubbles: true}));
let submit = document.querySelector("[data-testid=send-button");
submit.click();
}
fillQuery();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment