├── Chrome
├── icon.png
├── icon19.png
├── icon38.png
├── icon48.png
├── login_success.js
├── manifest.json
├── options.css
├── stackexchange-inbox-api-chrome.js
├── options-chromeonly.js
├── localStorage-proxy.js
├── options.html
├── inbox.html
├── inbox.js
├── stackexchange-inbox-api.js
├── options.js
└── using-websocket.js
├── .gitignore
├── screenshots
├── chrome_notif.png
├── chrome_options.png
├── chrome_inbox_panel.png
├── firefox_notif_win7.png
├── firefox_inbox_panel.png
├── firefox_notif_linux.png
├── firefox_notif_winxp.png
├── stackapps-screenshot.png
├── stackapps-thumbnail.png
├── firefox_options_widget.png
└── firefox_inbox_panel_after_login.png
├── se-logo.svg
├── Firefox
├── manifest.json
├── README.md
└── storage-sync-polyfill.js
├── Makefile
└── README.md
/Chrome/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rob--W/stackexchange-notifications/HEAD/Chrome/icon.png
--------------------------------------------------------------------------------
/Chrome/icon19.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rob--W/stackexchange-notifications/HEAD/Chrome/icon19.png
--------------------------------------------------------------------------------
/Chrome/icon38.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rob--W/stackexchange-notifications/HEAD/Chrome/icon38.png
--------------------------------------------------------------------------------
/Chrome/icon48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rob--W/stackexchange-notifications/HEAD/Chrome/icon48.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | Firefox/*
2 | !Firefox/manifest.json
3 | !Firefox/storage-sync-polyfill.js
4 | !Firefox/README.md
5 |
--------------------------------------------------------------------------------
/screenshots/chrome_notif.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rob--W/stackexchange-notifications/HEAD/screenshots/chrome_notif.png
--------------------------------------------------------------------------------
/screenshots/chrome_options.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rob--W/stackexchange-notifications/HEAD/screenshots/chrome_options.png
--------------------------------------------------------------------------------
/screenshots/chrome_inbox_panel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rob--W/stackexchange-notifications/HEAD/screenshots/chrome_inbox_panel.png
--------------------------------------------------------------------------------
/screenshots/firefox_notif_win7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rob--W/stackexchange-notifications/HEAD/screenshots/firefox_notif_win7.png
--------------------------------------------------------------------------------
/screenshots/firefox_inbox_panel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rob--W/stackexchange-notifications/HEAD/screenshots/firefox_inbox_panel.png
--------------------------------------------------------------------------------
/screenshots/firefox_notif_linux.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rob--W/stackexchange-notifications/HEAD/screenshots/firefox_notif_linux.png
--------------------------------------------------------------------------------
/screenshots/firefox_notif_winxp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rob--W/stackexchange-notifications/HEAD/screenshots/firefox_notif_winxp.png
--------------------------------------------------------------------------------
/screenshots/stackapps-screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rob--W/stackexchange-notifications/HEAD/screenshots/stackapps-screenshot.png
--------------------------------------------------------------------------------
/screenshots/stackapps-thumbnail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rob--W/stackexchange-notifications/HEAD/screenshots/stackapps-thumbnail.png
--------------------------------------------------------------------------------
/screenshots/firefox_options_widget.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rob--W/stackexchange-notifications/HEAD/screenshots/firefox_options_widget.png
--------------------------------------------------------------------------------
/screenshots/firefox_inbox_panel_after_login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rob--W/stackexchange-notifications/HEAD/screenshots/firefox_inbox_panel_after_login.png
--------------------------------------------------------------------------------
/Chrome/login_success.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | if (!/[#&]state=robw(&|$)/.test(location.hash)) {
3 | // OAuth not initiated by my application.
4 | return;
5 | }
6 |
7 | // Example of hash: #access_token=ZxqGlCmJzvrr99D(9dcEwA))&state=robw&expires=86400
8 | var token = location.hash.match(/\baccess_token=([^&]+)/)[1];
9 |
10 | var x = new XMLHttpRequest();
11 | x.open('GET', 'https://api.stackexchange.com/2.2/access-tokens/' + token);
12 | x.responseType = 'json';
13 | x.onloadend = function() {
14 | var account_id = x.response && x.response.items[0].account_id;
15 | chrome.runtime.sendMessage({
16 | auth_token: token,
17 | account_id: account_id,
18 | });
19 | };
20 | x.send();
21 | })();
22 |
--------------------------------------------------------------------------------
/Chrome/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Desktop Notifications for Stack Exchange",
3 | "description": "Real-time desktop notifications for the Stack Exchange.",
4 | "homepage_url": "https://stackapps.com/q/3780/9699",
5 | "version": "2.2",
6 | "manifest_version": 2,
7 | "background": {
8 | "scripts": [
9 | "localStorage-proxy.js",
10 | "stackexchange-inbox-api.js",
11 | "stackexchange-inbox-api-chrome.js",
12 | "using-websocket.js",
13 | "bridge.js"
14 | ]
15 | },
16 | "content_scripts": [{
17 | "matches": ["https://stackexchange.com/oauth/login_success*"],
18 | "run_at": "document_end",
19 | "js": ["login_success.js"]
20 | }],
21 | "options_ui": {
22 | "page": "options.html"
23 | },
24 | "optional_permissions": [
25 | "background"
26 | ],
27 | "browser_action": {
28 | "default_popup": "inbox.html",
29 | "default_icon": {
30 | "19": "icon19.png",
31 | "38": "icon38.png"
32 | }
33 | },
34 | "icons": {
35 | "48": "icon48.png",
36 | "128": "icon.png"
37 | },
38 | "permissions": [
39 | "https://api.stackexchange.com/*",
40 | "notifications",
41 | "storage",
42 | "tabs"
43 | ],
44 | "web_accessible_resources": [
45 | "icon.png"
46 | ]
47 | }
48 |
--------------------------------------------------------------------------------
/se-logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Firefox/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Desktop Notifications for Stack Exchange",
3 | "description": "Real-time desktop notifications for the Stack Exchange.",
4 | "homepage_url": "https://stackapps.com/q/3780/9699",
5 | "version": "2.2",
6 | "manifest_version": 2,
7 | "background": {
8 | "scripts": [
9 | "storage-sync-polyfill.js",
10 | "localStorage-proxy.js",
11 | "stackexchange-inbox-api.js",
12 | "stackexchange-inbox-api-chrome.js",
13 | "using-websocket.js",
14 | "bridge.js"
15 | ]
16 | },
17 | "content_scripts": [{
18 | "matches": ["https://stackexchange.com/oauth/login_success*"],
19 | "run_at": "document_end",
20 | "js": ["login_success.js"]
21 | }],
22 | "options_ui": {
23 | "page": "options.html"
24 | },
25 | "browser_action": {
26 | "default_popup": "inbox.html",
27 | "default_icon": {
28 | "19": "icon19.png",
29 | "38": "icon38.png"
30 | }
31 | },
32 | "icons": {
33 | "48": "icon48.png",
34 | "128": "icon.png"
35 | },
36 | "permissions": [
37 | "https://api.stackexchange.com/*",
38 | "notifications",
39 | "storage",
40 | "tabs"
41 | ],
42 | "web_accessible_resources": [
43 | "icon.png"
44 | ],
45 | "applications": {
46 | "gecko": {
47 | "id": "stackexchange-notifications@jetpack"
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | all: firefox chrome
2 | .PHONY: firefox chrome
3 |
4 | define mkicon
5 | inkscape -z -w "$2" -h "$2" se-logo.svg -e "$1icon$2.png"
6 | pngcrush -q -brute "$1icon$2.png"{,.} && mv "$1icon$2.png"{.,}
7 | endef
8 |
9 | chrome:
10 | cd Chrome && 7z u -tzip ../extension.zip *
11 |
12 | # After copying the source from Chrome,
13 | # remove unsupported keys (optional_permissions background),
14 | # and add applications.gecko.id.
15 | firefox:
16 | rsync -av Chrome/ Firefox/ --delete --exclude='.*' \
17 | --exclude=README.md \
18 | --exclude=storage-sync-polyfill.js
19 | cat Chrome/manifest.json | \
20 | tr '\n' '\t' | \
21 | sed 's/"localStorage-proxy.js"/"storage-sync-polyfill.js",\t \0/' | \
22 | sed 's/"optional_permissions":[^]]\+][^"]\+//' | \
23 | sed 's/\]\t\}/],\t "applications": {\t "gecko": {\t "id": "stackexchange-notifications@jetpack"\t }\t }\t}/' | \
24 | tr '\t' '\n' > Firefox/manifest.json
25 | cat Chrome/options.html | \
26 | tr '\n' '\t' | \
27 | sed 's/
48 |
49 |
50 |