Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] GM_deleteValue() 似乎在某些情况下存在问题,会造成数据被自动清空。 #249

Closed
Xia0xia0Xia0 opened this issue Dec 30, 2023 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@Xia0xia0Xia0
Copy link

最近尝试使用Scriptcat扩展,但发现一些内置API函数的bug,如下:

在脚本 字体渲染(自用脚本) 中,这段代码执行时, https://github.com/F9y4ng/GreasyFork-Scripts/blob/9891e78a2bdb63c0213eb329340d2ca39e7f2dde/Font%20Rendering.user.js#L4203C1-L4203C84 ,会出现数据无法保存的问题(数据总是被自动清空,即使重新写入新数据),而以上代码在TM或VM中都是可以正确执行的。

我怀疑是Scriptcat在GM_deleteValue()函数上的处理存在问题,只要将以上语句注释掉代码就可以正常执行了。因此,我感觉可能是GM_deleteValue()函数有bug,请作者检查并修复它,谢谢。

@CodFrm
Copy link
Member

CodFrm commented Dec 30, 2023

怎么进入这段代码呢?

@CodFrm
Copy link
Member

CodFrm commented Dec 30, 2023

这里不就是清理掉数据的逻辑么,我测试了一下,好像没有出现什么问题

https://1drv.ms/v/s!AsHfRGuv7yegoVC7GOEY8-Gk2n4I?e=xiY78H

@Xia0xia0Xia0
Copy link
Author

怎么进入这段代码呢?

这段代码是备份还原功能的,安装代码后,随便配置一下,然后导出本地备份,再用备份还原时就会出现无法还原的问题。我观察过,数据在还原本地备份时确实正常写入了,但页面刷新后新写入的数据就被自动清空。将4203行的代码注释掉,就能恢复正常。

其他脚本管理器没这问题,由此推断应该是Scriptcat的API有bug。

@KissChristina
Copy link

火狐浏览器也发现同样的问题 ,就是脚本设置之后一旦重启浏览器,之前的设置没有保存,除了字体渲染,这个https://greasyfork.org/zh-CN/scripts/460743 也是一样,脚本的选项设置重启浏览器就会失效

@CodFrm
Copy link
Member

CodFrm commented Jan 2, 2024

@Xia0xia0Xia0 @KissChristina 感谢反馈,这个问题已复现,我近期看看如何修复

@CodFrm CodFrm added the bug Something isn't working label Jan 7, 2024
@CodFrm CodFrm self-assigned this Feb 23, 2024
@CodFrm
Copy link
Member

CodFrm commented Feb 23, 2024

已修复,哥哥可以试试这个版本,是脚本并发setValue导致的数据错误,需要删除脚本重新安装一下

https://github.com/scriptscat/scriptcat/actions/runs/8017418015

@CodFrm CodFrm closed this as completed Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants