Skip to content

Commit

Permalink
AG-24523: fixed applying $cookie rules on the content-script side
Browse files Browse the repository at this point in the history
Merge in ADGUARD-FILTERS/tsurlfilter from fix/AG-24523 to master

Squashed commit of the following:

commit 00de879
Author: Dmitriy Seregin <[email protected]>
Date:   Mon Aug 21 12:51:08 2023 +0400

    fixed type

commit a9d3d35
Merge: 1c6949b 0e412d1
Author: Dmitriy Seregin <[email protected]>
Date:   Mon Aug 21 12:45:58 2023 +0400

    Merge branch 'master' into fix/AG-24523

commit 1c6949b
Merge: fabc714 bd5bcb4
Author: Dmitriy Seregin <[email protected]>
Date:   Mon Aug 14 18:23:40 2023 +0400

    Merge branch 'master' into fix/AG-24523

commit fabc714
Merge: 09f634f 56a602c
Author: Dmitriy Seregin <[email protected]>
Date:   Mon Aug 14 16:59:28 2023 +0400

    Merge branch 'master' into fix/AG-24523

commit 09f634f
Author: Dmitriy Seregin <[email protected]>
Date:   Sun Aug 13 18:20:01 2023 +0400

    undo tsconfig changes

commit 56fa25c
Merge: 746233f a9ac642
Author: Dmitriy Seregin <[email protected]>
Date:   Sun Aug 13 18:08:20 2023 +0400

    Merge branch 'master' into fix/AG-24523

commit 746233f
Author: Dmitriy Seregin <[email protected]>
Date:   Sun Aug 13 18:04:31 2023 +0400

    update jest dependencies && added tsconfig composite for child config

commit 4938689
Author: Dmitriy Seregin <[email protected]>
Date:   Mon Aug 7 18:01:05 2023 +0400

    fix

commit bae246b
Merge: 0509953 30ded45
Author: Dmitriy Seregin <[email protected]>
Date:   Fri Aug 4 21:21:26 2023 +0400

    Merge branch 'master' into fix/AG-24523

commit 0509953
Author: Dmitriy Seregin <[email protected]>
Date:   Fri Aug 4 21:20:52 2023 +0400

    fix

commit 182a2f8
Author: Dmitriy Seregin <[email protected]>
Date:   Fri Aug 4 02:25:07 2023 +0400

    simplified interface

commit 8dc42bf
Author: Dmitriy Seregin <[email protected]>
Date:   Wed Aug 2 15:00:10 2023 +0400

    AG-24523: fixed applying $cookie rules on the content-script side
  • Loading branch information
105th committed Aug 21, 2023
1 parent 0e412d1 commit 38196b9
Show file tree
Hide file tree
Showing 8 changed files with 489 additions and 528 deletions.
8 changes: 4 additions & 4 deletions packages/tsurlfilter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
},
"homepage": "https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/tsurlfilter#readme",
"scripts": {
"lint": "eslint 'src/**/*.ts' 'test/**/*.ts'",
"lint": "eslint 'src/**/*.ts' 'cli/**/*.ts' 'test/**/*.ts'",
"prebuild": "rimraf dist && yarn build:types",
"build": "rollup -c rollup.config.ts",
"postbuild": "node tasks/build-txt",
Expand Down Expand Up @@ -101,9 +101,9 @@
"@rollup/plugin-node-resolve": "13.3.0",
"@rollup/plugin-typescript": "8.3.4",
"@swc/core": "^1.3.75",
"@swc/jest": "^0.2.28",
"@swc/jest": "^0.2.29",
"@types/ip6addr": "0.2.3",
"@types/jest": "28.1.6",
"@types/jest": "29.5.3",
"@types/netmask": "1.0.30",
"@types/node": "18.7.1",
"@types/punycode": "2.1.0",
Expand All @@ -116,7 +116,7 @@
"eslint-plugin-import": "2.26.0",
"eslint-plugin-import-newlines": "1.2.3",
"eslint-plugin-jsdoc": "39.3.6",
"jest": "^29.3.1",
"jest": "^29.6.2",
"lint-staged": "13.0.3",
"lodash": "4.17.21",
"rimraf": "3.0.2",
Expand Down
20 changes: 14 additions & 6 deletions packages/tsurlfilter/test/rules/network-rule.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,12 @@ describe('NetworkRule.isHigherPriority', () => {
expect(l.isHigherPriority(r)).toBe(expected);
}

const priorityCases = [
type PriorityTestCase = {
key: string,
cases: [string, string, boolean][],
};

const priorityCases: PriorityTestCase[] = [
{
key: 'basicModifiers',
cases: [
Expand Down Expand Up @@ -1367,19 +1372,22 @@ describe('NetworkRule.isHigherPriority', () => {
.map(({ cases }) => cases)
.flat(1);

const cases: (string | boolean)[][] = [];
const cases: PriorityTestCase['cases'] = [];
casesGroup.cases.forEach((item) => {
// Check case itself
cases.push(item);
// Add a comparison with all past and lower priority groups
// Add a comparison with all past cases from lower priority groups
lowerPriorityCases.forEach((lowerPriorityCase) => {
cases.push([item[0], lowerPriorityCase[1], true]);
});
});

test.each(cases)('%s is a higher priority than %s, expected: %s', (left: string, right: string, expectedResult: boolean) => {
compareRulesPriority(left, right, expectedResult);
});
test.each(cases)(
'%s is a higher priority than %s, expected: %s',
(left: string, right: string, expectedResult: boolean) => {
compareRulesPriority(left, right, expectedResult);
},
);
});
});
});
Expand Down
Loading

0 comments on commit 38196b9

Please sign in to comment.