From f9b879572affa883a34f0017eba8d51c3076e2f6 Mon Sep 17 00:00:00 2001 From: Slava Leleka Date: Thu, 22 Feb 2024 13:17:02 +0200 Subject: [PATCH] Revert "Revert "cleanup"" This reverts commit bfebf14639ad881636a2ba0f7e28e6266dccd66d. --- .../background/request/request-blocking-api.ts | 2 -- .../src/lib/mv2/background/web-request-api.ts | 1 - .../request/request-blocking-api.test.ts | 17 ----------------- 3 files changed, 20 deletions(-) diff --git a/packages/tswebextension/src/lib/mv2/background/request/request-blocking-api.ts b/packages/tswebextension/src/lib/mv2/background/request/request-blocking-api.ts index d0117a980d..ab9c3a3844 100644 --- a/packages/tswebextension/src/lib/mv2/background/request/request-blocking-api.ts +++ b/packages/tswebextension/src/lib/mv2/background/request/request-blocking-api.ts @@ -19,7 +19,6 @@ export type GetBlockingResponseParams = { rule: NetworkRule | null, referrerUrl: string, requestUrl: string, - requestType: RequestType, contentType: ContentType, }; @@ -88,7 +87,6 @@ export class RequestBlockingApi { public static getBlockingResponse(data: GetBlockingResponseParams): WebRequest.BlockingResponse | void { const { rule, - requestType, tabId, eventId, requestUrl, diff --git a/packages/tswebextension/src/lib/mv2/background/web-request-api.ts b/packages/tswebextension/src/lib/mv2/background/web-request-api.ts index a10881fbed..0a8dfe5149 100644 --- a/packages/tswebextension/src/lib/mv2/background/web-request-api.ts +++ b/packages/tswebextension/src/lib/mv2/background/web-request-api.ts @@ -361,7 +361,6 @@ export class WebRequestApi { eventId, requestUrl, referrerUrl, - requestType, contentType, tabId, }); diff --git a/packages/tswebextension/test/lib/mv2/background/request/request-blocking-api.test.ts b/packages/tswebextension/test/lib/mv2/background/request/request-blocking-api.test.ts index b7838d5c61..25a55d40fe 100644 --- a/packages/tswebextension/test/lib/mv2/background/request/request-blocking-api.test.ts +++ b/packages/tswebextension/test/lib/mv2/background/request/request-blocking-api.test.ts @@ -16,7 +16,6 @@ jest.mock('@lib/mv2/background/api'); * * @param ruleText Rule text. * @param requestUrl Request url. - * @param requestType Request type. * @param contentType Content type. * * @returns Data for getBlockingResponse() method. @@ -24,7 +23,6 @@ jest.mock('@lib/mv2/background/api'); const getGetBlockingResponseParamsData = ( ruleText: string, requestUrl: string, - requestType: RequestType, contentType: ContentType, ): GetBlockingResponseParams => { return { @@ -33,7 +31,6 @@ const getGetBlockingResponseParamsData = ( rule: new NetworkRule(ruleText, 0), referrerUrl: '', requestUrl, - requestType, contentType, }; }; @@ -105,7 +102,6 @@ describe('Request Blocking Api - getBlockingResponse', () => { const data = getGetBlockingResponseParamsData( '||example.com^$popup', 'http://example.com', - RequestType.Document, ContentType.Document, ); const response = RequestBlockingApi.getBlockingResponse(data); @@ -116,7 +112,6 @@ describe('Request Blocking Api - getBlockingResponse', () => { const data = getGetBlockingResponseParamsData( '||example.com^$all', 'http://example.com', - RequestType.Document, ContentType.Document, ); const response = RequestBlockingApi.getBlockingResponse(data); @@ -129,7 +124,6 @@ describe('Request Blocking Api - getBlockingResponse', () => { const data = getGetBlockingResponseParamsData( '||example.com^$popup,document', 'http://example.com', - RequestType.Document, ContentType.Document, ); const response = RequestBlockingApi.getBlockingResponse(data); @@ -141,7 +135,6 @@ describe('Request Blocking Api - getBlockingResponse', () => { const data = getGetBlockingResponseParamsData( '||example.com^$popup', 'http://example.com/image.png', - RequestType.Image, ContentType.Image, ); const response = RequestBlockingApi.getBlockingResponse(data); @@ -152,7 +145,6 @@ describe('Request Blocking Api - getBlockingResponse', () => { const data = getGetBlockingResponseParamsData( '|http*://$popup', 'http://example.com/image.png', - RequestType.Image, ContentType.Image, ); const response = RequestBlockingApi.getBlockingResponse(data); @@ -163,7 +155,6 @@ describe('Request Blocking Api - getBlockingResponse', () => { const data = getGetBlockingResponseParamsData( '||example.com^', 'http://example.com', - RequestType.Document, ContentType.Document, ); const response = RequestBlockingApi.getBlockingResponse(data); @@ -174,7 +165,6 @@ describe('Request Blocking Api - getBlockingResponse', () => { const data = getGetBlockingResponseParamsData( '||example.com/script.js', 'http://example.com/script.js', - RequestType.Script, ContentType.Script, ); const response = RequestBlockingApi.getBlockingResponse(data); @@ -203,7 +193,6 @@ describe('Request Blocking Api - getBlockingResponse', () => { const data = getGetBlockingResponseParamsData( '||example.com^$popup', 'http://example.com', - RequestType.Document, ContentType.Document, ); const response = RequestBlockingApi.getBlockingResponse(data); @@ -214,7 +203,6 @@ describe('Request Blocking Api - getBlockingResponse', () => { const data = getGetBlockingResponseParamsData( '||example.com^$all', 'http://example.com', - RequestType.Document, ContentType.Document, ); const response = RequestBlockingApi.getBlockingResponse(data); @@ -225,7 +213,6 @@ describe('Request Blocking Api - getBlockingResponse', () => { const data = getGetBlockingResponseParamsData( '||example.com^$popup,document', 'http://example.com', - RequestType.Document, ContentType.Document, ); const response = RequestBlockingApi.getBlockingResponse(data); @@ -236,7 +223,6 @@ describe('Request Blocking Api - getBlockingResponse', () => { const data = getGetBlockingResponseParamsData( '||example.com^$popup', 'http://example.com/image.png', - RequestType.Image, ContentType.Image, ); const response = RequestBlockingApi.getBlockingResponse(data); @@ -247,7 +233,6 @@ describe('Request Blocking Api - getBlockingResponse', () => { const data = getGetBlockingResponseParamsData( '|http*://$popup', 'http://example.com/image.png', - RequestType.Image, ContentType.Image, ); const response = RequestBlockingApi.getBlockingResponse(data); @@ -258,7 +243,6 @@ describe('Request Blocking Api - getBlockingResponse', () => { const data = getGetBlockingResponseParamsData( '||example.com^', 'http://example.com', - RequestType.Document, ContentType.Document, ); const response = RequestBlockingApi.getBlockingResponse(data); @@ -269,7 +253,6 @@ describe('Request Blocking Api - getBlockingResponse', () => { const data = getGetBlockingResponseParamsData( '||example.com/script.js', 'http://example.com/script.js', - RequestType.Script, ContentType.Script, ); const response = RequestBlockingApi.getBlockingResponse(data);