[mv3] Minor code review

This commit is contained in:
Raymond Hill 2025-10-21 13:54:18 -04:00
parent 83974d4293
commit d6fc057d3b
No known key found for this signature in database
GPG key ID: F5630CAE62A14316

View file

@ -118,7 +118,7 @@ export const matchesFromHostnames = hostnames => {
export const hostnameFromMatch = origin => {
if ( origin === '<all_urls>' || 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 => {