Skip to content

Instantly share code, notes, and snippets.

@effektsvk
Last active February 6, 2024 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save effektsvk/7a732721b7e7903200ecb299a2ba3466 to your computer and use it in GitHub Desktop.
Save effektsvk/7a732721b7e7903200ecb299a2ba3466 to your computer and use it in GitHub Desktop.
Arc Boost for opening a new thread in ChatGPT
document.addEventListener("keydown", function (event) {
// Check if Cmd (on Mac) or Ctrl (on other platforms) is pressed along with 'N'
if ((event.metaKey || event.ctrlKey) && event.key === "n") {
event.preventDefault(); // Prevent the default action to ensure it doesn't interfere
// Define the XPath of the element to click
var xpath =
"/html/body/div[1]/div[1]/div[1]/div/div/div/div/nav/div[2]/div[1]/div/a";
// Use the XPath to find the element
var element = document.evaluate(
xpath,
document,
null,
XPathResult.FIRST_ORDERED_NODE_TYPE,
null,
).singleNodeValue;
// Simulate a click on the element if it exists
if (element) element.click();
}
});
@effektsvk
Copy link
Author

effektsvk commented Feb 6, 2024

I just found out that you can use Cmd + K without boost 🤦‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment