scriptcat icon indicating copy to clipboard operation
scriptcat copied to clipboard

[BUG] Import Script Failed - `@version` shall be optional

Open cyfung1031 opened this issue 1 month ago • 2 comments

Problem Description

I tried it and couldn't make my script work, but didn't have the time to investigate. So I just used the --disable--features command-line setting to give me a few more days/weeks with ViolentMonkey.

I imported all of my userscripts to ScriptCat today. I had 47 userscripts that I created and 7 that I installed from other sources.

None of my userscripts would import. ScriptCat wrote some confusing error stuff. Some of it was written in Chinese. And then it said something about me missing @author (I was using @namespace instead) and @description. I forgot what exactly. But these errors were inaccurate. I did not need either of those. The one line that I needed was @version. Without @version, ScriptCat won't let you import your userscript.

So check and see if you have that @version line at the top. I think the most important things, the bare minimum, are @name, @version, @author, @icon, @include, and @grant. The icon stuff is probably not necessary, but I like being able to tell which userscripts are mine at a glance by using an image that is different from other people's.

I only imported my userscripts a few minutes ago. But from what I can tell, they are working great. Unlike Tampermonkey, which is a pile of crap. I've always hated that extension. I don't see how anyone can use it. I remember testing it several times in the last few years and every time my Google userscript would not work until AFTER I refreshed the page. I want my userscripts to work automatically, not have to wait until I have refreshed the page. Not only that, but I think that I had five active userscripts on one website but it would only show me three of them in the drop down menu and not the ones I needed. If anyone wants to know what the best possible userscript extension is right now other than Violetmonkey, it has to be ScriptCat. Tampermonkey is a very distant third. OrangeMonkey should be avoided at all costs.

I am really sad that MV3 caused me to lose two extensions that I love - Violetmonkey and Alternate Player for Twitch.tv. If only those two extensions could be brought to MV3, I would be in Heaven.

https://github.com/violentmonkey/violentmonkey/issues/2341#issuecomment-3508508195


@CodFrm

  1. Stable Version is quite outdated. Translation issue is already fixed in BETA but not STABLE
  2. @version and @namespace should be optional. @namespace is default as "" but no default @version
  3. I am not sure about And then it said something about me missing @author (I was using @namespace instead) and @description but probably we should investigate.
  4. @version missing shall be treated as Error only in byEditor. See how I did in GM grant conflict checking.
  5. As we dont have @version in the script, just disable its update checking, rather than not allowing its import.
  6. Refer to VM, only @name is required. https://violentmonkey.github.io/api/metadata-block/
Image

Reproduction Steps

ScriptCat Version

Operating System and Browser Information

Additional Information (Optional)

No response

cyfung1031 avatar Nov 10 '25 01:11 cyfung1031

看起来只是一些必填项的问题,可以将 namespaceversion,放到byEditor里判断,我构造了一个测试文件

测试.zip

CodFrm avatar Nov 10 '25 01:11 CodFrm

看起来只是一些必填项的问题,可以将 namespaceversion,放到byEditor里判断,我构造了一个测试文件

测试.zip

我没确认 version 是空的话,更新检查那些和其他操作有没有影响。 namespace 那个应该已经预设为空 meta 少于3个那个回传null 应该要移除 只要有name就可以

cyfung1031 avatar Nov 10 '25 02:11 cyfung1031