From a91ba11185621664eb5fb7213454b17c33472673 Mon Sep 17 00:00:00 2001 From: Rob Wu Date: Tue, 10 Sep 2024 16:00:13 +0200 Subject: [PATCH] [CRX] Fix feature detect of DNR responseHeaders option Fix regression from #18711. `urlFilter` is a key of `condition`, not of the `rule`. Consequently, the feature detection method failed to detect the availability of the feature in Chrome 128+. --- extensions/chromium/pdfHandler.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/extensions/chromium/pdfHandler.js b/extensions/chromium/pdfHandler.js index bd440a923dd69..e0f3818c65d90 100644 --- a/extensions/chromium/pdfHandler.js +++ b/extensions/chromium/pdfHandler.js @@ -227,8 +227,10 @@ async function isHeaderConditionSupported() { addRules: [ { id: ruleId, - urlFilter: "|does_not_match_anything", - condition: { responseHeaders: [{ header: "whatever" }] }, + condition: { + responseHeaders: [{ header: "whatever" }], + urlFilter: "|does_not_match_anything", + }, action: { type: "block" }, }, ], @@ -244,8 +246,10 @@ async function isHeaderConditionSupported() { addRules: [ { id: ruleId, - urlFilter: "|does_not_match_anything", - condition: { responseHeaders: [] }, + condition: { + responseHeaders: [], + urlFilter: "|does_not_match_anything", + }, action: { type: "block" }, }, ],