ChatGPT Const to Var switch for Javascript snippets

ChatGPT always makes const variables in JavaScript snippets, and sometimes refuses to change it. This script solves the problem.

作者
Joan Doan
今日安裝
0
安裝總數
53
評價
0 0 0
版本
1.0.4
建立日期
2023-03-17
更新日期
2023-03-17
尺寸
4.4 KB
授權條款
GPL-3.0-or-later
腳本執行於

When ChatGPT outputs javascript snippets, it sometimes does not allow you to change the variables types to from const to var, so debugging and testing the code in js-console becomes complex(running the script multiple times gives errors of re-definition variables). This userscript solves the problem by extending code snippets UI.
New Buttons:
[Const/Var] - switches all const variable definitions to var, and back.
[COPY] - copies the code snippet (Use it instead of the standard copy button)
This script also adds ability to switch variable types (const/var/let) by clicking on them right in the code.
Just set up the types and click [COPY]. Testing code in javascript-console becomes a lot easier.

Don't copy code using standard button [Copy code], because it copies without any changes. Use new [COPY] button.

QingJ © 2025

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