mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Add check for managed API
This commit is contained in:
parent
e6831a3bef
commit
8aff1c6c99
1 changed files with 4 additions and 4 deletions
|
|
@ -65,7 +65,7 @@ page.initSettings = async function() {
|
|||
const item = await browser.storage.local.get({ 'settings': {} });
|
||||
|
||||
// Load managed settings if found
|
||||
if (isFirefox()) {
|
||||
if (isFirefox() && typeof(browser.storage.managed) === 'object') {
|
||||
try {
|
||||
const managedSettings = await browser.storage.managed.get('settings');
|
||||
if (managedSettings?.settings) {
|
||||
|
|
@ -73,16 +73,16 @@ page.initSettings = async function() {
|
|||
item.settings = managedSettings.settings;
|
||||
}
|
||||
} catch (err) {
|
||||
logError('page.initSettings error: ' + err);
|
||||
logError('page.initSettings: ' + err);
|
||||
}
|
||||
} else {
|
||||
} else if (typeof(chrome.storage.managed) === 'object') {
|
||||
chrome.storage.managed.get('settings').then((managedSettings) => {
|
||||
if (managedSettings?.settings) {
|
||||
debugLogMessage('Managed settings found.');
|
||||
item.settings = managedSettings.settings;
|
||||
}
|
||||
}).catch((err) => {
|
||||
logError('page.initSettings error: ' + err);
|
||||
logError('page.initSettings: ' + err);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue