Skip to content

Commit

Permalink
feat: provide feedback about changes when extension is updated
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrudz committed Sep 29, 2021
1 parent 3dc5015 commit 672af8d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion background/background.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var gaService = analytics.getService('JustNotSorryTest');

chrome.runtime.onInstalled.addListener(function () {
chrome.runtime.onInstalled.addListener(async function ({ reason }) {
var tracker = gaService.getTracker('UA-3535278-4'); // prod
var timing = tracker.startTiming('Analytics Performance', 'Send Event');
tracker.sendAppView('JustNotSorryInstalled');
Expand All @@ -24,6 +24,11 @@ chrome.runtime.onInstalled.addListener(function () {
},
]);
});

if (reason === 'update') {
const url = 'https://defmethodinc.github.io/just-not-sorry/upgraded';
await chrome.tabs.create({ url });
}
});

chrome.pageAction.onClicked.addListener(function () {
Expand Down
1 change: 1 addition & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"permissions": [
"https://www.google-analytics.com/",
"storage",
"tabs",
"declarativeContent"
]
}

0 comments on commit 672af8d

Please sign in to comment.