Skip to content

Commit

Permalink
Eliminated reliance on button label for observer click
Browse files Browse the repository at this point in the history
.... since localization can change it (adamlui/chatgpt-auto-continue#27) ↞ [auto-sync from `adamlui/chatgpt-auto-continue`]
  • Loading branch information
adamlui authored and kudo-sync-bot committed Mar 1, 2024
1 parent 632d44c commit a0c6183
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions chatgpt/chatgpt-auto-continue/chatgpt-auto-continue.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
// @description:zu ⚡ Terus menghasilkan imibuzo eminingi ye-ChatGPT ngokwesizulu
// @author Adam Lui
// @namespace https://github.com/adamlui
// @version 2024.2.26
// @version 2024.3.1
// @license MIT
// @match *://chat.openai.com/*
// @icon https://raw.githubusercontent.com/adamlui/userscripts/master/chatgpt/media/icons/openai-favicon48.png
Expand Down Expand Up @@ -300,9 +300,10 @@
const continueObserver = new MutationObserver(mutations =>
mutations.forEach(mutation => {
if (mutation.attributeName == 'style' && mutation.target.style.opacity == '1') {
document.querySelectorAll('button').forEach(button => {
if (button.textContent.includes('Continue generating')) {
button.click() ; notify(messages.notif_chatAutoContinued || 'Chat Auto-Continued', 'bottom-right')
document.querySelectorAll('button svg').forEach(svg => {
if (svg.querySelector('polygon[points*="11 19 2 12 11 5 11 19"]')) {
svg.parentNode.parentNode.click()
notify(messages.notif_chatAutoContinued || 'Chat Auto-Continued', 'bottom-right')
}})}}))
continueObserver.observe(document.querySelector('main'), { attributes: true, subtree: true })

Expand Down

0 comments on commit a0c6183

Please sign in to comment.