mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Add slash to URL from notification button
This commit is contained in:
parent
0ea9fb20e5
commit
afe66d3656
4 changed files with 15 additions and 8 deletions
|
|
@ -90,4 +90,10 @@ var matchPatternToRegExp = function(pattern) {
|
|||
var siteMatch = function(site, url) {
|
||||
const rx = matchPatternToRegExp(site);
|
||||
return url.match(rx);
|
||||
};
|
||||
|
||||
// Checks if URL has only scheme and host without the last / char.
|
||||
var slashNeededForUrl = function(pattern) {
|
||||
const matchPattern = new RegExp(`^${schemeSegment}://${hostSegment}$`);
|
||||
return matchPattern.exec(pattern);
|
||||
};
|
||||
|
|
@ -2053,9 +2053,13 @@ cip.ignoreSite = function(sites) {
|
|||
return;
|
||||
}
|
||||
|
||||
const site = sites[0];
|
||||
let site = sites[0];
|
||||
cip.initializeSitePreferences();
|
||||
|
||||
if (slashNeededForUrl(site)) {
|
||||
site += '/';
|
||||
}
|
||||
|
||||
// Check if the site already exists
|
||||
let siteExists = false;
|
||||
for (const existingSite of cip.settings['sitePreferences']) {
|
||||
|
|
|
|||
|
|
@ -314,7 +314,7 @@ options.initSitePreferences = function() {
|
|||
trClone.removeClass('clone');
|
||||
|
||||
// Fills the last / char if needed. This ensures the compatibility with Match Patterns
|
||||
if (options.slashNeededForUrl(value)) {
|
||||
if (slashNeededForUrl(value)) {
|
||||
value += '/';
|
||||
}
|
||||
|
||||
|
|
@ -396,9 +396,3 @@ options.initAbout = function() {
|
|||
$('#default-pass-shortcut').show();
|
||||
}
|
||||
};
|
||||
|
||||
// Checks if URL has only scheme and host without the last / char.
|
||||
options.slashNeededForUrl = function(pattern) {
|
||||
const matchPattern = new RegExp(`^${schemeSegment}://${hostSegment}$`);
|
||||
return matchPattern.exec(pattern);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,6 +4,9 @@ body {
|
|||
background-color: #eee;
|
||||
font-size: 15px;
|
||||
padding: 8px;
|
||||
min-width: 440px;
|
||||
max-width: 460px;
|
||||
width: auto;
|
||||
}
|
||||
.container {
|
||||
min-width: 440px;
|
||||
|
|
|
|||
Loading…
Reference in a new issue