mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Merge pull request #694 from keepassxreboot/fix/banner_with_site_preferences
Respect Site Preferences settings with the banner
This commit is contained in:
commit
6df0c5452e
2 changed files with 5 additions and 8 deletions
|
|
@ -44,12 +44,8 @@ kpxcBanner.create = async function(credentials = {}) {
|
|||
}
|
||||
|
||||
// Don't show anything if the site is in the ignore
|
||||
if (kpxc.settings.sitePreferences !== undefined) {
|
||||
for (const site of kpxc.settings.sitePreferences) {
|
||||
if (site.ignore !== IGNORE_NOTHING && (site.url === credentials.url || siteMatch(site.url, credentials.url))) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (kpxc.siteIgnored(IGNORE_NORMAL)) {
|
||||
return;
|
||||
}
|
||||
|
||||
kpxcBanner.created = true;
|
||||
|
|
|
|||
|
|
@ -885,7 +885,7 @@ kpxc.detectDatabaseChange = async function(response) {
|
|||
};
|
||||
|
||||
// Checks if the site has been ignored using Site Preferences
|
||||
kpxc.siteIgnored = function() {
|
||||
kpxc.siteIgnored = function(condition) {
|
||||
kpxc.initializeSitePreferences();
|
||||
if (kpxc.settings.sitePreferences) {
|
||||
let currentLocation;
|
||||
|
|
@ -897,9 +897,10 @@ kpxc.siteIgnored = function() {
|
|||
currentLocation = window.self.location.href;
|
||||
}
|
||||
|
||||
const currentSetting = condition || IGNORE_FULL;
|
||||
for (const site of kpxc.settings.sitePreferences) {
|
||||
if (siteMatch(site.url, currentLocation) || site.url === currentLocation) {
|
||||
if (site.ignore === IGNORE_FULL) {
|
||||
if (site.ignore === currentSetting) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue