AdguardTeam / CoreLibs

Core Adguard libraries
https://adguard.com/
Apache License 2.0
39 stars 7 forks source link

Provide the ability to add userscripts without specifying a resource #1889

Open danidoedel opened 2 months ago

danidoedel commented 2 months ago

Issue Details

Not quite sure if this is the correct repo for this kind of issue.

Some userscripts have an "incorrect" format, but still work fine in other userscript apps/extensions. Specifically in this case it is the @resource header. For this script it is pointing to a website, not a real resource used within the script. AdGuard fails to install the script while other apps/extensions can handle this. It would be great if AdGuard would allow this too.

Script has an incorrect format: image

Example script: https://update.greasyfork.org/scripts/463536/%2A%20Gebäude-%20%20Fuhrparkverwalter.user.js

I'm using AdGuard 2.15.0.1701 nightly on macOS Sonoma 14.5

Proposed solution

Ignore invalid resources.

Alternative solution

No response

Aydinv13 commented 2 months ago

@danidoedel Hello!

Unfortunately, such a script may simply fail without the @resource or be broken upon update, so we need to check the integrity of the script before installing or updating it.

danidoedel commented 2 months ago

@Aydinv13 I'm not quite sure if I fully understand this. As mentioned other major userscript extensions can handle such scripts just fine. Why wouldn't AdGuard be able to handle it the same way?

danidoedel commented 2 months ago

@Aydinv13 any further explanation why AdGuards behavior has to differ from other major userscript extensions? If there's no resource name, why not just ignore the resource?

Aydinv13 commented 2 months ago

As mentioned other major userscript extensions can handle such scripts just fine. Why wouldn't AdGuard be able to handle it the same way?

We'll think about how we can simplify adding a userscript in this case, thanks for asking.