Merge pull request #23 from keepassxreboot/credential_fix

Choose credential fields works with multiple windows visible
This commit is contained in:
Janek Bevendorff 2018-03-04 23:30:41 +01:00 committed by GitHub
commit cdf203bf06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,11 +15,16 @@ function initSettings() {
});
$('#settings #btn-choose-credential-fields').click(function() {
browser.runtime.getBackgroundPage().then((global) => {
browser.tabs.sendMessage(global.page.currentTabId, {
action: 'choose_credential_fields'
browser.windows.getCurrent().then((win) => {
browser.tabs.query({ 'active': true, 'currentWindow': true }).then((tabs) => {
const tab = tabs[0];
browser.runtime.getBackgroundPage().then((global) => {
browser.tabs.sendMessage(tab.id, {
action: 'choose_credential_fields'
});
close();
});
});
close();
});
});
}