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 人民的勤务员的反馈

评价:好评 - 脚本运行良好

§
发表于: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.

Emree.el作者
§
发表于: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

§
发表于:2024-09-01
编辑于: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.el作者
§
发表于: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.el作者
§
发表于:2024-09-08

Script got fixed now! :D

§
发表于: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.

Emree.el作者
§
发表于: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

发表回复

登录(不可用)以发表回复。

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址