Discussions » Greasy Fork Feedback

Improve match/include rules detection that uses regex

§
Posted: 2020-11-23
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
§
Posted: 2020-11-23

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

§
Posted: 2020-11-23
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
§
Posted: 2020-11-23
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
§
Posted: 2020-11-23
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.
§
Posted: 2020-11-24

/^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.

§
Posted: 2020-11-24
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
§
Posted: 2020-11-24

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.

§
Posted: 2020-11-24
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

Post reply

Sign in to post a reply.