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.)

< Σχολιασμός για τον κώδικα ChatGPT Character Counter Limit (CCCL) FIXED BY 人民的勤务员

Αναφορά: Καλός - ο κώδικας λειτουργεί

§
Δημοσιεύτηκε: 31/08/2024

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.elΔημιουργός
§
Δημοσιεύτηκε: 31/08/2024

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

§
Δημοσιεύτηκε: 01/09/2024
Επεξεργάστηκε: 01/09/2024

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.elΔημιουργός
§
Δημοσιεύτηκε: 08/09/2024

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.elΔημιουργός
§
Δημοσιεύτηκε: 08/09/2024

Script got fixed now! :D

§
Δημοσιεύτηκε: 08/09/2024

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.elΔημιουργός
§
Δημοσιεύτηκε: 08/09/2024

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

Δημοσίευση απάντησης

Συνδεθείτε για να δημοσιεύσετε μια απάντηση.