AdguardTeam / AdguardForiOS

The most advanced ad blocker for iOS
https://adguard.com/
GNU General Public License v3.0
1.43k stars 202 forks source link

App crashes if you try to add an incompatible rule to User filter #285

Closed vozersky closed 7 years ago

vozersky commented 7 years ago

For example, JS:

STR:

  1. Add to Userfilter: www.example.com#%#var fuckAdBlock = false
Alex-302 commented 7 years ago

Another rule:

4pda.ru##body > div[id^="r"] > div[class^="r"] > div[class^="r"] > div[id^="r"] > div[class]:empty+div[class^="r"][class*=" r"]:not(:empty) > section[id]

If :empty is removed, I can add rule.

vozersky commented 7 years ago

Another rule: 4pda.ru##body > div[id^="r"] > div[class^="r"] > div[class^="r"] > div[id^="r"] > div[class]:empty+div[class^="r"][class*=" r"]:not(:empty) > section[id] If :empty is removed, I can add rule.

reproduced here

@Stillness-2 :empty is supposed to work in iOS, no?

Alex-302 commented 7 years ago

@vozersky http://www.w3schools.com/cssref/sel_empty.asp

ameshkov commented 7 years ago

@Alex-302 btw :empty may also be unsupported in other AG versions. Are you sure it works ok in Windows/Mac/extension?

Alex-302 commented 7 years ago

@ameshkov it works at least with AG for Windows and Chrome extension.

![image](http://imagizer.imageshack.com/img921/7453/ZuMyzA.png)
vityevato commented 7 years ago

commit c7d8a10. Now, If error occurs when converting of rule, app raises error modal dialog window.