AdguardTeam / FiltersCompiler

A tool that compiles & validates filters
GNU Lesser General Public License v3.0
52 stars 12 forks source link

Convert the first parameter in prevent-window-open scriptlet to "!" or no "!" for uBlock version of lists #103

Closed Yuki2718 closed 2 years ago

Yuki2718 commented 3 years ago

AG uses "0" for "not include" and "1" for "include" in prevent-window-open scriptlet, but in uBO the first parameter is always URL (matches to the second parameter of AG) and instead "!" is used for negation.

So for example dutafilm.*#%#//scriptlet("prevent-window-open", "1", "bit.ly") in Base filter, currently converted to dutafilm.*##+js(window.open-defuser, 1, bit.ly), should be converted to dutafilm.*##+js(window.open-defuser, bit.ly) and ebd.cda.pl#%#//scriptlet("prevent-window-open", "0", "cda.pl") to ebd.cda.pl##+js(window.open-defuser, !cda.pl)

slavaleleka commented 2 years ago

AdGuard's prevent-window-open supports both old and new syntax, as well as uBO's window.open-defuser as I see. so if rules are working fine, there is no need for AG-old → UBO-new syntax rules conversion