Closed Eugene706 closed 1 year ago
@105th Is there any instruction on how to set your own rules for the extension? Like this in MV2 - https://github.com/AdguardTeam/AdguardBrowserExtension/blob/master/Extension/api/sample-extension/adguard-api.md
@105th Is there any instruction on how to set your own rules for the extension? Like this in MV2 - https://github.com/AdguardTeam/AdguardBrowserExtension/blob/master/Extension/api/sample-extension/adguard-api.md
MV3 uses declarativeNet Request and every rule has a unique id and rules with duplicate id's are not allowed so the method to declare them will be programmatically a little different. You can however add rules for the settings/options page directly. It supports nearly all parameters mentioned in https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters
@Rutuj-Runwal I thought only network rules use declarativeNetRequest
@Rutuj-Runwal I thought only network rules use declarativeNetRequest
Yes only network rules are governed by declarativeNetRequest. Cosmetic filters are handled separately and they follow the rules mentioned in the link that I shared in the discussion above.
@Rutuj-Runwal My question was to which function in the code of the extension I need to pass these rules in order to see the result of their execution on the page
@Eugene706 we decided to separate the work with Chrome Declarative API in our open library - tswebextension
So you only need to pass the configuration there (with declarative rule sets included, which are prepared when the extension is built) - https://github.com/AdguardTeam/AdGuardMV3/blob/master/src/background/tswebextension.ts#L40
Also, if you want to change the static filter rules, check the following https://github.com/AdguardTeam/AdGuardMV3/blob/master/README.md#for-filters-maintainers (step 4)
@Eugene706 Yes, I think it is possible because the license is the same as in the MV2 extension we updated the license, you can read it here - https://github.com/AdguardTeam/AdGuardMV3/blob/master/LICENSE