Chrome extension Discourse v0.2

api
javascript

(Alessandro) #1

Chrome extension for discourse is at v0.2: thanks to djfarrelly collaboration, it shows notification list with a popup ! You can install it from here


Google Chrome extension for discourse notifications
Discourse Chrome Extension to show unread count
(Erlend Sogge Heggen) #2

Nice! I don’t suppose it’d be possible to make it distinguish between ordinary notifications and private message notifications? (i.e. blue vs green notifications). Or alternatively set it to only show PM notifications.

Thing is, I don’t want to be distracted every time I receive a like or there’s activity in a topic I follow, but if there’s a PM waiting for a reply from me, that deserves my attention.

Edit: I suggest renaming the app to “Discourse Notifications”


(Mittineague) #3

Errrrm , you may need to rethink the name. “Discourse” is already taken :wink:


(Alessandro) #4

Not now, but sure, I already thought about it and I think that it can be useful.
My idea is to choose the activation in the option page with a checkbox
Thank you for the reporting and any feedback is welcome :wink:


(Jeff Atwood) #5

Agreed please change the name to Discourse notifications, or something like that.


(Alessandro) #6

Done. I’ve changed the name using your advice “Discourse Notifications”, see here.
Are there any problems with the icon ? and with github repo name ?


(Sam Saffron) #7

The rule to follow is

“Will anyone confuse my software with an officially built piece of software”


(Anton) #8

@alep, a really nice and tiny thing!

A few propositions

  1. It would be nice if we could authorize the plugin to multiple Discourse instances!

  2. Once authorized, it would either show a few icons in the Chrome toolbar OR show the summary of new notifications and then detailed per-item list once you click the icon.

  3. Instead of showing the default Discource icon, show the icon of the setup the plugin is logged in.


(Alessandro) #9
  1. Multi-site support is on my todo list ;), but now I’m going to add it to features list on github.
    I thought to implement it showing each notifications group with an accordion menu.

  2. I don’t know if one single chrome extension can shows multiple icons on the toolbar, I will investigate.

  3. Good idea !

Thanks for all the feedback ! :+1:


(Ilya Kuchaev) #10

What about some sharing capabilities? Something like share this page to Discourse which will post a link to.


(Kane York) #11

You should request the “data on all sites” permission and automatically add sites you visit when window.Discourse exists and window.Discourse.User.current() is truthy. Don’t poll /notifications?silent=true - use the message bus instead. You’ll need to handle the case when the message bus position gets reset.

Also, how about “Notifications for Discourse” for the title?


(Alessandro) #12

Can be the following a valid example ?
I am on the url www.example.com, right click on the page and the contextual menù has the “share with discourse site” item. Clicking it will open the page to create a new post with a preformatted page link.
Other than right click could be a semi transparent icon always present in the bottom right corner of the page or in the chrome omnibox or with a new menu item clicking the extension icon.


(Alessandro) #13

I think that only the user can add a site in the future multi-site support feature.
If the extension automatically add sites, I think it could be annoying. Eventually an option could be present to enable the extension to propose a list of the visited discourse site and the user can finally choose to activate them.

Don’t poll /notifications?silent=true - use the message bus instead.

The extension already using MessageBus.
/notifications?silent=true is used only on boot to get the user id. It is the only method I have discovered to get the user id as I explained in this post , because I did not found the documentation. I’ve asked about it. It exists ?

Also, how about “Notifications for Discourse” for the title?

I’ve changed the title as suggested by @codinghorror.


(Mittineague) #14

AFAIK these 3 are equivalent, maybe you could use one?

Discourse.User.currentProp("id");
Discourse.User.current().get("id");
Discourse.User.current().id;

(Kane York) #15

The last one will fail on certain browsers or if an observer is set up on it.


(Alessandro) #16

Thank you for the advice, but I think that it may not be possible:
Discourse object is present in the discourse site environment, but the chrome extension has its own environment where Discourse object does not exist.


(Kane York) #17

Well, just collect the user ID during site detection then and sendMessage() to the extension page or send it over some other way.