Discussions » Greasy Fork Feedback

Scripts being deleted for the reason "Minified code"

§
Posted: 2021-07-25

https://greasyfork.org/zh-CN/scripts/374903-comicread The script is deleted because of the minified code, but only the code of the external library in the script has been compressed. I don’t have @require because I can load it lazily. And much like the source is indicated in the comment https://github.com/hymbz/ComicReadScript/blob/master/ComicRead.user.js#L49

This should be consistent with "Libraries that a script uses should be @require-d, unless there's a valid technical reason not to do so. In the case that a library is included inline, it must include information as to the source of the library (e.g. a comment indicating URL and/or name and version)." Regular.


https://greasyfork.org/zh-CN/scripts/374903-comicread 脚本因为 Minified code 被删除了,但脚本中只有外部库的代码有被压缩过,我是为了能懒加载才没有 @require 的,并且也在注释中标明了来源 https://github.com/hymbz/ComicReadScript/blob/master/ComicRead.user.js#L49

这应该是符合「库是应被 @require 的脚本,除非因为技术原因不能这么做。如果一个库被内嵌入了脚本,那么你必须一并提供库的来源(比如一行评论指向原始地址、名称以及版本)。」规则的。

wOxxOmMod
§
Posted: 2021-07-25
Edited: 2021-07-25

There's no sensible way to verify that you didn't modify the code inside that long minified line because your links are unversioned. I've seen that happen before so the only case we allow embedded libraries is when it specifically targets a browser that doesn't support @require although personally I see no reason to allow this on GreasyFork at all. I'd say those few scripts should find another gallery that is more permissive. @JasonBarnabe.

§
Posted: 2021-07-25

Can I change it like this?

// @resource    name    CDN-URL

// use
eval(GM_getResourceText('name'))
wOxxOmMod
§
Posted: 2021-07-25

Sure, but it won't work on sites with Content-Security-Policy that forbids unsafe-eval like github.com.

§
Posted: 2021-07-25

Thank you very much, I have modified the code. After testing, there is no website, which has problems with Unsafe-Eval, so modification is feasible. I have already released a new version of code on GitHub, can I restore my script?

https://github.com/hymbz/ComicReadScript/blob/master/ComicRead.user.js#L54


非常感谢,我已经修改好了代码,经过测试没有网站因为设置了 unsafe-eval 而出现问题,这样修改是可行的。我已经在 github 上发布了新版代码,可以恢复我的脚本了吗?

wOxxOmMod
§
Posted: 2021-07-25

You can update your deleted script, then notify any moderator or post a comment here.

§
Posted: 2021-07-25

Thank you, I have updated the code, trouble you.


谢谢,我已经更新了代码,麻烦你了

§
Posted: 2021-07-26
I've seen that happen before so the only case we allow embedded libraries is when it specifically targets a browser that doesn't support @require although personally I see no reason to allow this on GreasyFork at all.
The reason it's allowed is for cases when the library is not on a CDN, like for very narrowly focused things (integration into a game, for example).

Post reply

Sign in to post a reply.