quoid / userscripts

An open-source userscript manager for Safari
https://quoid.github.io/userscripts/
GNU General Public License v3.0
3.26k stars 184 forks source link

Unable to download URLs containing hash but without search #583

Closed F9y4ng closed 8 months ago

F9y4ng commented 11 months ago

greasyfork.org updated the reference address format of @require, causing the SRI Hash used in the new address to not be downloaded correctly in v4.4.5, as follows:

// @require    https://update.greasyfork.org/scripts/460897/1277476/gbCookies.js#sha256-Sv+EuBerch8z/6LvAU0m/ufvjmqB1Q/kbQrX7zAvOPk=

But the original reference address as follows, can be parsed and downloaded correctly.

// @require    https://greasyfork.org/scripts/460897/code/gbCookies.js?version=1277476#sha256-Sv+EuBerch8z/6LvAU0m/ufvjmqB1Q/kbQrX7zAvOPk=

Please fix this bug, thanks.

ACTCD commented 11 months ago

There is some confusion with the encoding of URL in Swift...

This issue will be attempted to be fixed in the next minor version. So unlike a hot fix i.e. patch version, this will take some period.

As a interim solution, this will works: You can add a ? just in front of the # to bypass the error for now. (Please note this is still a legally correct URL)

It is worth noting that SRI Hash in URL is not implemented in this extension.

F9y4ng commented 11 months ago

According to the rules for external code allowed by greasyfork.org (https://greasyfork.org/en/help/external-scripts), external resources using non-specified CDNs may use scripts with sub-resource integrity hashes attached.

So it doesn't refer specifically to greasyfork's own script library resources, but there are other resource addresses that can fail to parse.so please fix this bug as soon as possible. Thanks.

ACTCD commented 11 months ago

@F9y4ng In case you miss it, I'll reply to you again:

You can add a ? just in front of the # to bypass the error for now.

F9y4ng commented 11 months ago

Hi @ACTCD, I already knew that adding URL Search Parameter can temporarily solve the problem before reporting this issue. Because this BUG will cause script errors or failure, I hope you can just raise the fix level, nothing more. Haha😀

ACTCD commented 11 months ago

@F9y4ng I believe this is not a fatal error and not that common, so I will try to fix it in the next version. Unless you want to contribute code directly. This may raise the fix level (still no guarantees). Please understand that we only have a limited time to contribute to this open source project.

Anyway, thanks for reporting the issue. And thank you for your contributions to this project.

F9y4ng commented 11 months ago

Please don't mind, I don't mean to rush you, update it according to your progress. I just think it may cause the script to fail completely, so I'd like to give a hint.

Thanks for your reply.

ACTCD commented 8 months ago

The fix has been released with the new beta version. Sorry this took so long.

F9y4ng commented 8 months ago

The fix has been released with the new beta version. Sorry this took so long.

That's ok, thanks.