update message data keys

This commit is contained in:
Kyle Spearrin 2018-01-13 10:19:05 -05:00
parent 52c370f2b9
commit 4077630a92
3 changed files with 5 additions and 5 deletions

View File

@ -269,10 +269,10 @@ export default class RuntimeBackground {
const responseVal: any = {}; const responseVal: any = {};
if (responseCommand === 'notificationBarDataResponse') { if (responseCommand === 'notificationBarDataResponse') {
responseVal.neverDomains = await this.storageService.get<string[]>(ConstantsService.neverDomainsKey); responseVal.neverDomains = await this.storageService.get<string[]>(ConstantsService.neverDomainsKey);
responseVal.disableAddLoginNotification = await this.storageService.get<boolean>( responseVal.disabledNotification = await this.storageService.get<boolean>(
ConstantsService.disableAddLoginNotificationKey); ConstantsService.disableAddLoginNotificationKey);
} else if (responseCommand === 'autofillerAutofillOnPageLoadEnabledResponse') { } else if (responseCommand === 'autofillerAutofillOnPageLoadEnabledResponse') {
responseVal.enableAutoFillOnPageLoad = await this.storageService.get<boolean>( responseVal.autofillEnabled = await this.storageService.get<boolean>(
ConstantsService.enableAutoFillOnPageLoadKey); ConstantsService.enableAutoFillOnPageLoadKey);
} }

View File

@ -1,6 +1,5 @@
document.addEventListener('DOMContentLoaded', (event) => { document.addEventListener('DOMContentLoaded', (event) => {
let pageHref = null; let pageHref = null;
const enabledKey = 'enableAutoFillOnPageLoad';
if ((typeof safari !== 'undefined')) { if ((typeof safari !== 'undefined')) {
const responseCommand = 'autofillerAutofillOnPageLoadEnabledResponse'; const responseCommand = 'autofillerAutofillOnPageLoadEnabledResponse';
@ -10,13 +9,14 @@ document.addEventListener('DOMContentLoaded', (event) => {
}); });
safari.self.addEventListener('message', function (msgEvent) { safari.self.addEventListener('message', function (msgEvent) {
const msg = msgEvent.message; const msg = msgEvent.message;
if (msg.command === responseCommand && msg.data[enabledKey] === true) { if (msg.command === responseCommand && msg.data.autofillEnabled === true) {
setInterval(doFillIfNeeded, 500); setInterval(doFillIfNeeded, 500);
} }
}, false); }, false);
return; return;
} }
else { else {
const enabledKey = 'enableAutoFillOnPageLoad';
chrome.storage.local.get(enabledKey, (obj) => { chrome.storage.local.get(enabledKey, (obj) => {
if (obj && obj[enabledKey] === true) { if (obj && obj[enabledKey] === true) {
setInterval(doFillIfNeeded, 500); setInterval(doFillIfNeeded, 500);

View File

@ -31,7 +31,7 @@ document.addEventListener('DOMContentLoaded', function (event) {
return; return;
} }
if (notificationBarData.disableAddLoginNotification === true) { if (notificationBarData.disabledNotification === true) {
return; return;
} }