diff --git a/src/converters/helpers.js b/src/converters/helpers.js index 82b8429..2c1d94b 100644 --- a/src/converters/helpers.js +++ b/src/converters/helpers.js @@ -22,6 +22,7 @@ export const DEFAULT_PARAM_MAPPING = { '3p': 'third-party', xhr: 'xmlhttprequest', frame: 'subdocument', + from: 'domain', }; export const DEFAULT_RESOURCES_MAPPING = generateResourcesMapping(); diff --git a/test/unit/converters/adguard.spec.js b/test/unit/converters/adguard.spec.js index a65e6e0..cb77d93 100644 --- a/test/unit/converters/adguard.spec.js +++ b/test/unit/converters/adguard.spec.js @@ -34,6 +34,29 @@ describe('adguard converter', () => { }); }); + // https://github.com/ghostery/broken-page-reports/blob/5627595ed0f86c64171f38860013978ff0329907/filters/fixes.txt#L1306-L1311 + it('*$image,redirect-rule=1x1.gif,from=web.de', async () => { + const { rules } = await convertWithAdguard(['*$image,redirect-rule=1x1.gif,from=web.de'], { + resourcesPath: '/test', + }); + expect(rules[0]).toEqual({ + id: 1, + action: { + type: 'redirect', + redirect: { + extensionPath: '/test/1x1.gif', + }, + }, + condition: { + initiatorDomains: ['web.de'], + resourceTypes: ['image'], + isUrlFilterCaseSensitive: false, + urlFilter: '', + }, + priority: 1301, + }); + }); + it('handles regexp with ?', async () => { const { rules } = await convertWithAdguard(['/a?/']); expect(rules[0]).toEqual({