mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Merge pull request #20 from keepassxreboot/clear_logins_fix
Prevent multiple page_clear_logins
This commit is contained in:
commit
d2eb986289
3 changed files with 8 additions and 4 deletions
|
|
@ -256,8 +256,10 @@ kpxcEvent.onMultipleFieldsPopup = function(callback, tab) {
|
|||
browserAction.show(null, tab);
|
||||
};
|
||||
|
||||
kpxcEvent.pageClearLogins = function(callback, tab) {
|
||||
page.clearLogins(tab.id);
|
||||
kpxcEvent.pageClearLogins = function(callback, tab, alreadyCalled) {
|
||||
if (!alreadyCalled) {
|
||||
page.clearLogins(tab.id);
|
||||
}
|
||||
callback();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
// contains already called method names
|
||||
var _called = {};
|
||||
_called.retrieveCredentials = false;
|
||||
_called.clearLogins = false;
|
||||
_called.manualFillRequested = 'none';
|
||||
|
||||
// Count of detected form fields on the page
|
||||
|
|
@ -1213,7 +1214,8 @@ cip.initCredentialFields = function(forceCall) {
|
|||
}
|
||||
_called.initCredentialFields = true;
|
||||
|
||||
browser.runtime.sendMessage({ 'action': 'page_clear_logins' }).then(() => {
|
||||
browser.runtime.sendMessage({ 'action': 'page_clear_logins', args: [_called.clearLogins] }).then(() => {
|
||||
_called.clearLogins = true;
|
||||
const inputs = cipFields.getAllFields();
|
||||
cipFields.prepareVisibleFieldsWithID('select');
|
||||
cip.initPasswordGenerator(inputs);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
$(function() {
|
||||
browser.runtime.getBackgroundPage().then((global) => {
|
||||
browser.tabs.query({"active": true, "currentWindow": true}).then((tabs) => {
|
||||
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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue