Greasy Fork is available in English.

Dyskusje » Greasy Fork Feedback

Improve match/include rules detection that uses regex

§
Napisano: 23-11-2020
Isn't that hard to find that a lot of match and include rules are not correctly "displayed" by greasyfork. They are not translated into the websites, so the scripts are not easy to find.
wOxxOmMod
§
Napisano: 23-11-2020

Might be possible by using a regexp parser to build an array of possibilities and analyze it. Probably not trivial though.

§
Napisano: 23-11-2020
This shouldn't be something hard to implement, I also don't think it's trivial. If it was trivial greasyfork wouldn't already have this feature, and also wouldn't have a filter to filter/search for scripts by the site that are on the script match/include rules.

I mean why is this regex /^https:\/\/myanimelist\.net\/anime\/[\d]+(\/.*)?/ understood by greasyfork that the script works on myanimelist.net
while this regex /^https:\/\/myanimelist\.net\/anime\/[0-9]+\/* is not displayed as being a script made for myanimelist.net?
These 2 regexs aren't that much different anyways,this seems to be a greasyfork bug
§
Napisano: 23-11-2020
It's probably just a lack of imagination on my part. As you note, some cases are handled. If you can come up with a list then I can look into it. Or better yet you can try coding it yourself.

https://github.com/JasonBarnabe/greasyfork/blob/master/lib/js_parser.rb#L106
https://github.com/JasonBarnabe/greasyfork/blob/master/test/lib/js_parser_applies_to_test.rb
§
Napisano: 23-11-2020
Thanks. I don't have an account on github, for now I would like not to have one...
I will think if I will do this list or not on my spare time.
§
Napisano: 24-11-2020

/^https:\/\/myanimelist\.net\/anime\/[0-9]+\/*

This is not considered a regex as it doesn't end with a slash. With it not being a regex, it's considered a glob, and so it doesn't see that as a valid URL due to the special characters everywhere.

§
Napisano: 24-11-2020
Thanks. This makes sense.
But I'm not sure if the other scripts I see also have this same problem, or if is something different
§
Napisano: 24-11-2020

Well like I said, if you see examples, let me know. I can fix and add it to the test suite. The current code is definitely not handling everything.

§
Napisano: 24-11-2020
sure,I will think if I will do this list or not on my spare time.I want to help, and I will if I can

Odpowiedz

Zaloguj się, by odpowiedzieć.