Choose credential fields works with multiple windows visible

This commit is contained in:
varjolintu 2018-02-28 10:39:13 +02:00 committed by Janek Bevendorff
parent b498b76a02
commit 5b5a3fcc84

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();
});
});
}