mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Add special handling of file:// since there is no host.
This commit is contained in:
parent
4a17805d81
commit
aba6823eec
1 changed files with 12 additions and 0 deletions
|
|
@ -61,6 +61,18 @@ const matchPatternToRegExp = function(pattern) {
|
|||
return (/^(?:http|https|file|ftp|app):\/\//);
|
||||
}
|
||||
|
||||
// special handling of file:// since there is no host
|
||||
if (pattern.startsWith('file://')) {
|
||||
let regex = '^';
|
||||
if (pattern.endsWith('*')) {
|
||||
regex += pattern.slice(0, -1);
|
||||
}
|
||||
else {
|
||||
regex += `${pattern}$`;
|
||||
}
|
||||
return new RegExp(regex);
|
||||
}
|
||||
|
||||
const matchPatternRegExp = new RegExp(
|
||||
`^${schemeSegment}://${hostSegment}/${pathSegment}$`
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue