Skip to content

Commit

Permalink
feat: display a notification if the feed could not be found
Browse files Browse the repository at this point in the history
  • Loading branch information
teddy-gustiaux committed Nov 11, 2018
1 parent 224738b commit 53eb70d
Show file tree
Hide file tree
Showing 27 changed files with 55 additions and 22 deletions.
17 changes: 17 additions & 0 deletions assets/icons/error.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
3 changes: 3 additions & 0 deletions src/_locales/en/messages.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"pageActionTitle": {
"message": "Display the RSS feed of this channel"
},
"feedRetrievalError": {
"message": "The RSS feed of this channel could not be found."
}
}
3 changes: 3 additions & 0 deletions src/_locales/fr/messages.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"pageActionTitle": {
"message": "Afficher le flux RSS de cette chaîne"
},
"feedRetrievalError": {
"message": "Le flux RSS de cette chaîne n'a pas pu être trouvé."
}
}
3 changes: 3 additions & 0 deletions src/_locales/ru/messages.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"pageActionTitle": {
"message": "Просмотреть RSS ленту этого канала"
},
"feedRetrievalError": {
"message": "The RSS feed of this channel could not be found."
}
}
8 changes: 7 additions & 1 deletion src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ class Utils {
} else if (url.split('/').length === 4) {
identifier = Utils.buildFeedIdentifier(url, 'youtube.com/', 'user');
}
console.log(identifier)
if (identifier !== null) return FEED_BASE_URL + identifier;
return null;
}
Expand Down Expand Up @@ -115,6 +114,13 @@ async function onPageActionClick(tab) {
url: feed,
active: true,
});
} else {
browser.notifications.create('', {
type: 'basic',
title: browser.runtime.getManifest().name,
message: browser.i18n.getMessage('feedRetrievalError'),
iconUrl: browser.extension.getURL('icons/error/error-96.png'),
});
}
}

Expand Down
Binary file added src/icons/error/error-1024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/error/error-128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/error/error-16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/error/error-24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/error/error-256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/error/error-32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/error/error-48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/error/error-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/error/error-64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/error/error-96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
43 changes: 22 additions & 21 deletions src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,23 @@

"permissions": [
"activeTab",
"tabs"
"tabs",
"notifications"
],

"page_action": {
"default_title": "__MSG_pageActionTitle__",
"default_icon": {
"16": "icon/youtube-rss-finder-16.png",
"24": "icon/youtube-rss-finder-24.png",
"32": "icon/youtube-rss-finder-32.png",
"48": "icon/youtube-rss-finder-48.png",
"64": "icon/youtube-rss-finder-64.png",
"96": "icon/youtube-rss-finder-96.png",
"128": "icon/youtube-rss-finder-128.png",
"256": "icon/youtube-rss-finder-256.png",
"512": "icon/youtube-rss-finder-512.png",
"1024": "icon/youtube-rss-finder-1024.png"
"16": "icons/logo/youtube-rss-finder-16.png",
"24": "icons/logo/youtube-rss-finder-24.png",
"32": "icons/logo/youtube-rss-finder-32.png",
"48": "icons/logo/youtube-rss-finder-48.png",
"64": "icons/logo/youtube-rss-finder-64.png",
"96": "icons/logo/youtube-rss-finder-96.png",
"128": "icons/logo/youtube-rss-finder-128.png",
"256": "icons/logo/youtube-rss-finder-256.png",
"512": "icons/logo/youtube-rss-finder-512.png",
"1024": "icons/logo/youtube-rss-finder-1024.png"
},
"browser_style": true,
"show_matches": [
Expand All @@ -37,16 +38,16 @@
},

"icons": {
"16": "icon/youtube-rss-finder-16.png",
"24": "icon/youtube-rss-finder-24.png",
"32": "icon/youtube-rss-finder-32.png",
"48": "icon/youtube-rss-finder-48.png",
"64": "icon/youtube-rss-finder-64.png",
"96": "icon/youtube-rss-finder-96.png",
"128": "icon/youtube-rss-finder-128.png",
"256": "icon/youtube-rss-finder-256.png",
"512": "icon/youtube-rss-finder-512.png",
"1024": "icon/youtube-rss-finder-1024.png"
"16": "icons/logo/youtube-rss-finder-16.png",
"24": "icons/logo/youtube-rss-finder-24.png",
"32": "icons/logo/youtube-rss-finder-32.png",
"48": "icons/logo/youtube-rss-finder-48.png",
"64": "icons/logo/youtube-rss-finder-64.png",
"96": "icons/logo/youtube-rss-finder-96.png",
"128": "icons/logo/youtube-rss-finder-128.png",
"256": "icons/logo/youtube-rss-finder-256.png",
"512": "icons/logo/youtube-rss-finder-512.png",
"1024": "icons/logo/youtube-rss-finder-1024.png"
},

"background": {
Expand Down

0 comments on commit 53eb70d

Please sign in to comment.