listen for events in safari on bg runtime

This commit is contained in:
Kyle Spearrin 2018-01-12 23:15:27 -05:00
parent f01ee13102
commit 6c7646a481
2 changed files with 13 additions and 14 deletions

View File

@ -39,7 +39,7 @@
<key>Filename</key>
<string>popup/index.html</string>
<key>Height</key>
<integer>667</integer>
<integer>600</integer>
<key>Identifier</key>
<string>bitwarden-popup</string>
<key>Width</key>
@ -73,6 +73,7 @@
<key>Start</key>
<array>
<string>content/autofill.js</string>
<string>content/autofiller.js</string>
</array>
</dict>
<key>Stylesheets</key>

View File

@ -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) => {