From d6750cfd61b8fd6329980dcfcaf8600b836da2ac Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 31 Mar 2017 08:32:59 -0400 Subject: [PATCH] catch exceptions when trying to resolve element by id --- src/content/field.js | 5 ++++- src/content/notificationBar.js | 10 ++++++++-- src/content/overlay.js | 5 ++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/content/field.js b/src/content/field.js index f6edb89a..77bd4b1c 100644 --- a/src/content/field.js +++ b/src/content/field.js @@ -1,4 +1,7 @@ -!(function () { +// THIS FILE IS NOT CURRENTLY IN USE +// IT IS NOT LOADED IN THE MANIFEST + +!(function () { var icons = [], setIconsIntervalId = null, setIconsIntervalRunCount = 0, diff --git a/src/content/notificationBar.js b/src/content/notificationBar.js index 888a2212..964fe67b 100644 --- a/src/content/notificationBar.js +++ b/src/content/notificationBar.js @@ -72,7 +72,10 @@ inputs = document.getElementsByTagName('input'); if (passwordId && passwordId !== '') { - formDataObj.passwordEl = formDataObj.formEl.querySelector('#' + passwordId); + try { + formDataObj.passwordEl = formDataObj.formEl.querySelector('#' + passwordId); + } + catch (e) { } } if (!formDataObj.passwordEl && passwordName !== '') { formDataObj.passwordEl = formDataObj.formEl.querySelector('input[name="' + passwordName + '"]'); @@ -88,7 +91,10 @@ } if (usernameId && usernameId !== '') { - formDataObj.usernameEl = formDataObj.formEl.querySelector('#' + usernameId); + try { + formDataObj.usernameEl = formDataObj.formEl.querySelector('#' + usernameId); + } + catch (e) { } } if (!formDataObj.usernameEl && usernameName !== '') { formDataObj.usernameEl = formDataObj.formEl.querySelector('input[name="' + usernameName + '"]'); diff --git a/src/content/overlay.js b/src/content/overlay.js index 4ab6fdf4..821a44ed 100644 --- a/src/content/overlay.js +++ b/src/content/overlay.js @@ -1,4 +1,7 @@ -!(function () { +// THIS FILE IS NOT CURRENTLY IN USE +// IT IS NOT LOADED IN THE MANIFEST + +!(function () { chrome.runtime.onMessage.addListener(function (msg, sender, sendResponse) { if (msg.command === 'openOverlayPopup') { closePopup();