catch exceptions when trying to resolve element by id

This commit is contained in:
Kyle Spearrin 2017-03-31 08:32:59 -04:00
parent 622b337ee2
commit d6750cfd61
3 changed files with 16 additions and 4 deletions

View File

@ -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,

View File

@ -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 + '"]');

View File

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