From 3154ed1bac227e4bc683c919d8d10bd01c9f8bb6 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Thu, 17 Feb 2022 09:07:56 -0500 Subject: [PATCH] Remove test for whether Chromium version is less than 66 The test is no longer needed given that the minimum supported version is Chromium 66. --- platform/common/vapi-background.js | 7 ------- platform/common/vapi-common.js | 7 ++----- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/platform/common/vapi-background.js b/platform/common/vapi-background.js index 0c4b0b46d..0d3cc584e 100644 --- a/platform/common/vapi-background.js +++ b/platform/common/vapi-background.js @@ -45,13 +45,6 @@ if ( vAPI.canWASM === false ) { vAPI.supportsUserStylesheets = vAPI.webextFlavor.soup.has('user_stylesheet'); -// The real actual webextFlavor value may not be set in stone, so listen -// for possible future changes. -window.addEventListener('webextFlavor', function() { - vAPI.supportsUserStylesheets = - vAPI.webextFlavor.soup.has('user_stylesheet'); -}, { once: true }); - /******************************************************************************/ vAPI.app = { diff --git a/platform/common/vapi-common.js b/platform/common/vapi-common.js index 552642b7d..e9f00dc62 100644 --- a/platform/common/vapi-common.js +++ b/platform/common/vapi-common.js @@ -83,12 +83,9 @@ vAPI.webextFlavor = { // Synchronous -- order of tests is important const match = /\bChrom(?:e|ium)\/([\d.]+)/.exec(ua); if ( match !== null ) { - soup.add('chromium'); + soup.add('chromium') + .add('user_stylesheet'); flavor.major = parseInt(match[1], 10) || 0; - // https://github.com/gorhill/uBlock/issues/3588 - if ( flavor.major >= 66 ) { - soup.add('user_stylesheet'); - } } // Don't starve potential listeners