Skip to content

Commit

Permalink
Shortened button-get method defs
Browse files Browse the repository at this point in the history
  • Loading branch information
adamlui committed Sep 16, 2024
1 parent 3c38adf commit b549ff7
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions chatgpt.js
Original file line number Diff line number Diff line change
Expand Up @@ -895,12 +895,7 @@ const chatgpt = { // eslint-disable-line no-redeclare
},

getNewChatLink() { return document.querySelector('nav a[href="/"]'); },

getRegenerateButton() {
for (const mainSVG of document.querySelectorAll('main svg')) {
if (mainSVG.querySelector('path[d^="M3.06957"]')) // regen icon found
return mainSVG.parentNode;
}},
getRegenerateButton() { return document.querySelector('button:has([d^="M3.06957"])'); },

getResponse() {
// * Returns response via DOM by index arg if OpenAI chat page is active, otherwise uses API w/ following args:
Expand All @@ -920,11 +915,7 @@ const chatgpt = { // eslint-disable-line no-redeclare
|| document.querySelector('path[d*="M15.192 8.906a1.143"]')?.parentNode.parentNode; // post-GPT-4o
},

getStopGeneratingButton() {
for (const svg of document.querySelectorAll('form button svg')) {
if (svg.querySelector('path[d*="2 0 0 1 2"], rect'))
return svg.parentNode;
}},
getStopGeneratingButton() { return document.querySelector('button:has([d*="2 0 0 1 2"], rect)'); },

getUserLanguage() {
return navigator.languages[0] || navigator.language || navigator.browserLanguage ||
Expand Down

0 comments on commit b549ff7

Please sign in to comment.