From 6c7646a481bcd24c773154265034f749a75bd7b4 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 12 Jan 2018 23:15:27 -0500 Subject: [PATCH] listen for events in safari on bg runtime --- src/Info.plist | 3 ++- src/background/runtime.background.ts | 24 +++++++++++------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/Info.plist b/src/Info.plist index fda8253e19..637e090d18 100644 --- a/src/Info.plist +++ b/src/Info.plist @@ -39,7 +39,7 @@ Filename popup/index.html Height - 667 + 600 Identifier bitwarden-popup Width @@ -73,6 +73,7 @@ Start content/autofill.js + content/autofiller.js Stylesheets diff --git a/src/background/runtime.background.ts b/src/background/runtime.background.ts index 91df38e517..d4eeb8e8b4 100644 --- a/src/background/runtime.background.ts +++ b/src/background/runtime.background.ts @@ -48,21 +48,19 @@ export default class RuntimeBackground { win.location.href = href; } }, true); + } else { + if (this.runtime.onInstalled) { + this.runtime.onInstalled.addListener((details: any) => { + (window as any).ga('send', { + hitType: 'event', + eventAction: 'onInstalled ' + details.reason, + }); - return; - } - - if (this.runtime.onInstalled) { - this.runtime.onInstalled.addListener((details: any) => { - (window as any).ga('send', { - hitType: 'event', - eventAction: 'onInstalled ' + details.reason, + if (details.reason === 'install') { + chrome.tabs.create({ url: 'https://bitwarden.com/browser-start/' }); + } }); - - if (details.reason === 'install') { - chrome.tabs.create({ url: 'https://bitwarden.com/browser-start/' }); - } - }); + } } BrowserApi.messageListener(async (msg: any, sender: any, sendResponse: any) => {