Skip to content

Commit

Permalink
Merge pull request #258 from micz/main
Browse files Browse the repository at this point in the history
Fixing changes in ChatGPT web interface
  • Loading branch information
adamlui authored May 16, 2024
2 parents 3744b30 + 47caf31 commit a9e8e4e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions chatgpt.js
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,11 @@ const chatgpt = { // eslint-disable-line no-redeclare
getResponseFromAPI: function(chatToGet, responseToGet) { return chatgpt.response.getFromAPI(chatToGet, responseToGet); },
getResponseFromDOM: function(pos) { return chatgpt.response.getFromDOM(pos); },
getScrollToBottomButton: function() { return document.querySelector('button[class*="cursor"][class*="bottom"]'); },
getSendButton: function() { return document.querySelector('form button[class*="bottom"]'); },

getSendButton: function() {
return document.querySelector('[data-testid="send-button"]') // pre-GPT-4o
|| document.querySelector('path[d*="M15.192 8.906a1.143"]')?.parentNode.parentNode; // post-GPT-4o
},

getStopGeneratingButton: function() {
for (const svg of document.querySelectorAll('form button svg')) {
Expand Down Expand Up @@ -1457,7 +1461,7 @@ const chatgpt = { // eslint-disable-line no-redeclare
);
response = responseDivs[nthOfResponse - 1].textContent;
}
response = response.replace(/^ChatGPTChatGPT/, ''); // strip sender name
response = response.replace(/^ChatGPT(?:ChatGPT)?/, ''); // strip sender name
}
return response;
},
Expand Down

0 comments on commit a9e8e4e

Please sign in to comment.