mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
More various fixes
This commit is contained in:
parent
b1b5e3642e
commit
971d5e5e42
3 changed files with 32 additions and 36 deletions
|
|
@ -6,18 +6,12 @@ keepass.migrateKeyRing().then(() => {
|
|||
keepass.connectToNative();
|
||||
keepass.generateNewKeyPair();
|
||||
keepass.changePublicKeys(null, (pkRes) => {
|
||||
keepass.getDatabaseHash((gdRes) => {
|
||||
// create tab information structure for every opened tab
|
||||
page.initOpenedTabs();
|
||||
|
||||
// set initial tab-ID
|
||||
browser.tabs.query({"active": true, "currentWindow": true}).then((tabs) => {
|
||||
if (tabs.length === 0)
|
||||
return; // For example: only the background devtools or a popup are opened
|
||||
page.currentTabId = tabs[0].id;
|
||||
browserAction.show(null, tabs[0]);
|
||||
});
|
||||
}, null);
|
||||
// create tab information structure for every opened tab
|
||||
page.initOpenedTabs().then(() => {
|
||||
keepass.getDatabaseHash((gdRes) => {
|
||||
|
||||
}, null);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ var page = {};
|
|||
page.tabs = {};
|
||||
|
||||
page.currentTabId = -1;
|
||||
page.settings = (typeof(localStorage.settings) === 'undefined') ? {} : JSON.parse(localStorage.settings);
|
||||
page.blockedTabs = {};
|
||||
|
||||
page.migrateSettings = () => {
|
||||
|
|
@ -64,10 +63,23 @@ page.initSettings = function() {
|
|||
}
|
||||
|
||||
page.initOpenedTabs = function() {
|
||||
browser.tabs.query({}).then((tabs) => {
|
||||
for (const i of tabs) {
|
||||
page.createTabEntry(i.id);
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
browser.tabs.query({}).then(function (tabs) {
|
||||
for (var i = 0; i < tabs.length; i++) {
|
||||
page.createTabEntry(tabs[i].id);
|
||||
}
|
||||
|
||||
// set initial tab-ID
|
||||
browser.tabs.query({ "active": true, "currentWindow": true }).then(function (tabs) {
|
||||
if (tabs.length === 0) {
|
||||
resolve();
|
||||
return; // For example: only the background devtools or a popup are opened
|
||||
}
|
||||
page.currentTabId = tabs[0].id;
|
||||
browserAction.show(null, tabs[0]);
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1098,6 +1098,15 @@ cip.credentials = [];
|
|||
|
||||
jQuery(function() {
|
||||
cip.init();
|
||||
|
||||
// Detect div's that include forms and are visible
|
||||
const divDetect = setInterval(function() {
|
||||
const fields = cipFields.getAllFields();
|
||||
if (fields.length > 0) {
|
||||
cip.initCredentialFields(true);
|
||||
clearInterval(divDetect);
|
||||
}
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
cip.init = function() {
|
||||
|
|
@ -1697,22 +1706,3 @@ cipEvents.triggerActivatedTab = function() {
|
|||
}).then(cip.retrieveCredentialsCallback);
|
||||
}
|
||||
}
|
||||
|
||||
// Detect div's that include forms and are visible
|
||||
$(function() {
|
||||
const divDetect = setInterval(function() {
|
||||
/*browser.tabs.query({ active: true, currentWindow: true }).then((tabs) => {
|
||||
const fields = cipFields.getAllFields();
|
||||
if (fields.length > 0) {
|
||||
cip.initCredentialFields(true);
|
||||
clearInterval(divDetect);
|
||||
}
|
||||
});*/
|
||||
const fields = cipFields.getAllFields();
|
||||
if (fields.length > 0) {
|
||||
cip.initCredentialFields(true);
|
||||
clearInterval(divDetect);
|
||||
}
|
||||
console.log("Check..");
|
||||
}, 1000);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue