~apreiml/simple-password-manager

f6979bc0c8f901d62729cd74bede6127ed8e29b8 — Armin Preiml 4 years ago b7a611a
refactor
1 files changed, 5 insertions(+), 8 deletions(-)

M toolbar-popup/login.js
M toolbar-popup/login.js => toolbar-popup/login.js +5 -8
@@ 1,10 1,6 @@
let passwordRepository = browser.runtime.connect({name:"popup-port"});
passwordRepository.onMessage.addListener(function (m) {
   document.querySelector('#message').textContent = m.text;
});

function listenForClicks() {
  document.addEventListener("click", (e) => {
document.addEventListener("click", (e) => {
    if (e.target.classList.contains('login-button')) {
        let form = e.target.closest('form');
        let email = form.querySelector('input[name="email"]').value;


@@ 16,7 12,8 @@ function listenForClicks() {
            password: password
        });
    }
  });
}
});

listenForClicks();
passwordRepository.onMessage.addListener(function (m) {
   document.querySelector('#message').textContent = m.text;
});