ChatGPT Character Counter Limit (CCCL) FIXED BY 人民的勤务员

Adds a character counter to the input field with a limit of 32732 characters. (ChatGPT has a limit of 32732 characters.)

< Commentaires sur ChatGPT Character Counter Limit (CCCL) FIXED BY 人民的勤务员

Avis: Bon - le script fonctionne correctement

I have to say, this is a really useful script.
Thank you to the author and thank God. A little problem: When a new chat is opened, this counter will not be displayed. Because the page has changed, you should use an observer to check the counter, and the counter disappears and is re-created.

Emree.elAuteur
§
Posté le: 2024-08-31

I have to say, this is a really useful script.
Thank you to the author and thank God.
A little problem:
When a new chat is opened, this counter will not be displayed. Because the page has changed, you should use an observer to check the counter, and the counter disappears and is re-created.

Thanks for the nice review 人民的勤务员! :D
Yeah, I'm aware of this problem and I'm currently trying to fix it, thanks for the advise too, I'll use it :))
I'll let you know when I fixed it :D
- Emree.el

§
Posté le: 2024-09-01
Édité le: 2024-09-01

I have to say, this is a really useful script.Thank you to the author and thank God.A little problem:When a new chat is opened, this counter will not be displayed. Because the page has changed, you should use an observer to check the counter, and the counter disappears and is re-created. Thanks for the nice review 人民的勤务员! :D Yeah, I'm aware of this problem and I'm currently trying to fix it, thanks for the advise too, I'll use it :))I'll let you know when I fixed it :D- Emree.el

Thanks to the author for the reply. I just saw your reply today

With God's help I fixed this script
document.querySelector('[aria-label="Send prompt"]');This can only be selected to the ChatGPT English website, and other languages ​​cannot be selected. For example, if I am a Chinese user, then this element is document.querySelector('[aria-label="发送提示"]'); so I changed it and also fixed the problem of addEventListener('click' due to element changes. Invalid question.
Now we can display the counter when the web page changes.

 textarea.addEventListener('input', function () {
                updateCounter()
            })
            document.querySelector('body').addEventListener('click', function (event) {
                const button = event.target.closest('button[data-testid="send-button"]')
                if (button) updateCounter()
            })
        }
    }
    let lastUrl = location.href
    new MutationObserver(() => {
        const url = location.href
        if (url !== lastUrl) {
            lastUrl = url
            addCharacterCounter()
            console.log("change", url)
        }
    }).observe(document, { subtree: true, childList: true })
    // Run the function after the page loads
    window.addEventListener('load', addCharacterCounter)

Emree.elAuteur
§
Posté le: 2024-09-08

I just saw this reply, greasy fork didnt notify me, apologies for that.
But I was trying to fix it the whole time and I just realised what I did wrong, thanks man, I'll fix the script and I'll credit you
Have a blessed day man and may God bless you

Emree.elAuteur
§
Posté le: 2024-09-08

Script got fixed now! :D

I just saw this reply, greasy fork didnt notify me, apologies for that.But I was trying to fix it the whole time and I just realised what I did wrong, thanks man, I'll fix the script and I'll credit youHave a blessed day man and may God bless you

man you can use this script
GreasyFork Discussion Watcher

On GreasyFork, when there are new replies to your scripts or discussions you're involved in, the latest discussion content will be displayed on the webpage.

Emree.elAuteur
§
Posté le: 2024-09-08

I just saw this reply, greasy fork didnt notify me, apologies for that.But I was trying to fix it the whole time and I just realised what I did wrong, thanks man, I'll fix the script and I'll credit youHave a blessed day man and may God bless you

man you can use this script
GreasyFork Discussion Watcher

On GreasyFork, when there are new replies to your scripts or discussions you're involved in, the latest discussion content will be displayed on the webpage.

Thanks man, I just installed it! :D

Poster une réponse

Connectez-vous pour poster une réponse.