From d6fc057d3be108e334c0b68597803e8e7d6dc4f8 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Tue, 21 Oct 2025 13:54:18 -0400 Subject: [PATCH] [mv3] Minor code review --- platform/mv3/extension/js/utils.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/platform/mv3/extension/js/utils.js b/platform/mv3/extension/js/utils.js index cab0b972a..22aa5631a 100644 --- a/platform/mv3/extension/js/utils.js +++ b/platform/mv3/extension/js/utils.js @@ -118,7 +118,7 @@ export const matchesFromHostnames = hostnames => { export const hostnameFromMatch = origin => { if ( origin === '' || origin === '*://*/*' ) { return 'all-urls'; } - const match = reOriginToHostname.exec(origin); + const match = /^\*:\/\/(?:\*\.)?([^/]+)\/\*/.exec(origin); if ( match === null ) { return ''; } return match[1]; }; @@ -133,8 +133,6 @@ export const hostnamesFromMatches = origins => { return out; }; -const reOriginToHostname = /^\*:\/\/(?:\*\.)?([^/]+)\/\*/; - /******************************************************************************/ const broadcastMessage = message => {