Skip to content

Commit

Permalink
Open issue on uninstall (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudLigny authored Sep 4, 2021
1 parent 8d84814 commit 231abbd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "f-notifier",
"version": "2.7.1",
"version": "2.7.2",
"description": "Displays your Facebook notifications unread count.",
"homepage": "https://narno.dev/F-Notifier/",
"author": "Arnaud Ligny",
Expand Down
14 changes: 14 additions & 0 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const FETCH_URL = 'https://m.facebook.com/';
const HOME_URL = 'https://www.facebook.com/';
const NOTIFICATIONS_URL = HOME_URL + 'notifications';
const RELEASES_URL = 'https://github.com/Narno/F-Notifier/releases';
const ISSUES_URL = 'https://github.com/Narno/F-Notifier/issues';

/**
* Main functions
Expand Down Expand Up @@ -155,16 +156,29 @@ chrome.browserAction.onClicked.addListener(tab => {

// Check whether new version is installed
chrome.runtime.onInstalled.addListener(details => {
// Set default options
if (details.reason === chrome.runtime.OnInstalledReason.INSTALL) {
localStorage.setItem('isFriendsReq', true);
localStorage.setItem('isShowUpdates', true);
chrome.runtime.openOptionsPage();
}

// Open releases details on update
if (details.reason === chrome.runtime.OnInstalledReason.UPDATE && localStorage.getItem('isShowUpdates') === 'true') {
chrome.tabs.create({url: RELEASES_URL});
}

// Open issue on uninstall
chrome.runtime.setUninstallURL((() => {
switch (chrome.i18n.getUILanguage()) {
case 'fr':
return ISSUES_URL + '/new?labels=survey&title=Mon+avis+à+propos+de+cette+extension';
case 'en':
default:
return ISSUES_URL + '/new?labels=survey&title=My+opinion+about+this+extension';
}
})());

updateBadge();
});

Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "__MSG_extName__",
"version": "2.7.1",
"version": "2.7.2",
"description": "__MSG_extDescription__",
"homepage_url": "https://narno.dev/F-Notifier/",
"author": "Arnaud Ligny",
Expand Down

0 comments on commit 231abbd

Please sign in to comment.