AdguardTeam / AdguardForAndroid

Open bug tracker for Android version of AdGuard.
https://adguard.com/
1.22k stars 86 forks source link

Importing user scripts is not working. #5354

Closed bropines closed 2 weeks ago

bropines commented 3 weeks ago

Please answer the following questions for yourself before submitting an issue

AdGuard version

4.5.16

Environment

HTTPS filtering

Root access

Integration with AdGuard VPN

Routing mode

Local VPN

Ad Blocking

No response

Privacy

No response

Social

No response

Annoyances

No response

Security

No response

Language-specific

No response

Other

No response

Which DNS server do you use?

AdGuard DNS

DNS protocol

None

Custom DNS

No response

What Stealth Mode options do you have enabled?

No response

Issue Details

Steps to reproduce:

  1. Try to add a user script via a link or file
  2. The administrator will write that the link is incorrect

Expected Behavior

No response

Actual Behavior

It doesn't work)

Screenshots

Screenshot 1 ![Screenshot_2024-06-08-09-17-08-749_com adguard android](https://github.com/AdguardTeam/AdguardForAndroid/assets/57861007/d9a5c14b-274d-4749-a8a1-8e1f92ccc3b2)
Screenshot 2 ![Screenshot_2024-06-08-09-23-06-989_com adguard android](https://github.com/AdguardTeam/AdguardForAndroid/assets/57861007/20d86a87-61fe-499a-b0a9-ad93f84af7cd)

Additional Information

No response

bropines commented 2 weeks ago

I guess either you're looking for a mistake by the sweat of your brow, or you just forgot)

maxikuzmin commented 2 weeks ago

@bropines thank you for the long wait!

Could you please share the link you are trying to add the script from?

I tried adding the script using the link and also using the file - the import works correctly

I used to test this script, you can try adding it for comparison

bropines commented 2 weeks ago

But I don’t want anything @maxikuzmin . For some reason your script is added, but mine doesn’t even want to be added from the file.

https://github.com/AdguardTeam/AdguardForAndroid/assets/57861007/b1e44dea-40c8-4a4a-8cd5-f7b9e8087472

maxikuzmin commented 2 weeks ago

@bropines there must be something wrong with your file. Check the file format (it should be .js) Maybe the file path or link path has changed, check that too.

Anyway, the problem is not in the application but in the file/link, otherwise other scripts would not be added as well

bropines commented 2 weeks ago

So, no, it wasn't fixed. It’s not even imported from a file, but for the developer (whom I mentioned here) everything magically works. And the question is, either I’m schizoid, or something is broken.

hymbz commented 2 weeks ago

It should be related to @resource.

https://github.com/AdguardTeam/AdguardForAndroid/assets/17750128/15f9f814-5afe-4043-a723-991e0b373624

After switching to jsdelivr, scripts can be imported through local files. Is this caused by network issues? However, if I use a URL to import, it can be successfully imported without switching to jsdelivr.

bropines commented 1 week ago

@maxikuzmin you can add logging (or tell me how to debug) that the import does not work because of the script itself, or the Internet. Now if I write complete nonsense in the script it will just write that the path to the file is not correct, which is quite confusing.