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 => {