Fix WebExtension startup and URI matching compatibility

This commit is contained in:
wuggy 2026-09-19 04:08:21 -07:00
commit dbc2b42c7f
2 changed files with 16 additions and 3 deletions

View file

@ -89,9 +89,22 @@ SingleMatchPattern.prototype = {
let suffix = host.substr(2);
let dotSuffix = "." + suffix;
return ({host}) => host === suffix || host.endsWith(dotSuffix);
return uri => {
try {
let host = uri.host;
return host === suffix || host.endsWith(dotSuffix);
} catch (e) {
return false;
}
};
}
return uri => uri.host === host;
return uri => {
try {
return uri.host === host;
} catch (e) {
return false;
}
};
},
matches(uri, ignorePath = false) {