Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Chrome extension for Vanilla notifications

AaronWebsteyAaronWebstey Headband AfficionadoCole Harbour, NS ✭✭✭
edited January 2015 in Vanilla 2.0 - 2.8

Is anyone interested in a VF notifications checker extension for chrome that I wrote? It works on 2.1.8 with a simple plugin installed (it could be easily adapted to work with API instead). It simply polls for notifications every X minutes, and adds a notification count to the icon when there are new ones found. Clicking the icon opens the same notifications drop-down you see on your forum, and clicking a link in the drop-down opens the forum discussion in a new tab.

Right now it's hard-coded for my forum, but if anyone is interested then I'll add a settings page and post it to GH.

«1

Comments

  • ToddTodd Chief Product Officer Vanilla Staff

    This is amazing. Out of curiosity, what goes into developing a chrome extension?

  • AdrianAdrian Wandering Spirit Montreal MVP

    @Todd, it's just some html, js and css: https://developer.chrome.com/extensions/getstarted

    I built some before, but it's been a long time. And of course @AaronWebstey‌ used them in cool way :)

  • hgtonighthgtonight ∞ · New Moderator

    I would definitely be interested in seeing the source code.

    I want this ported this to Firefox. :)

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • AdrianAdrian Wandering Spirit Montreal MVP

    @hgtonight it's an awesome idea -- I know less about making Firefox add-ons, but it would certainly be helpful in both cases. Personally, I would love it just to use for .org, so I don't miss a thing :p

  • AaronWebsteyAaronWebstey Headband Afficionado Cole Harbour, NS ✭✭✭

    Thanks for the compliments! :)

    @Adrian‌ the problem with using it for .org is that I had to make a plugin for my site to make it work. There may be a way to do it without a plugin; I've sent the code to @hgtonight‌ (and will post here if anyone wants), he may have an idea. Basically, I needed an efficient way to get just the counts for the logged-in user (notifications and messages, then I add them together to get the icon number since both show up in the drop-down).

    @Todd‌ Yeah, it's actually the first one I've written and it only took a few hours - I am experienced with HTML/JS, but only low-to-moderate experience with VF thus far, so you get the idea of how simple it is.

    Oh what the heck, I may as well just post the code. I'll strip out the reference to our site, so that people don't start downloading it and hitting our server by accident :)

    Notes:

    • you'll need to either a) replace YOURFORUMHERE.com with your URL in manifest.json, dostyle.js, browser_action.html, and background.js. Or (even better) set up a settings page where you can input the forum name. I'm not sure how much work that entails as I got it working on my site and gave up :) The options_custom and options_simple directories are stock and untouched by me (I may have deleted some sample options or something).
    • dostyle.js is poorly-named; it actually loads the notifcations page into the drop-down.
    • in browser_action.html, I just load the site's main style.css, so there's no theme-based customization. If you know of a good way to load the css for your site's theme here, please let me know :)
    • As mentioned, for the notifier to work, you'll need to install the NotificationCounts plugin on your site. And again, if anyone knows a way to do this without requiring an extension, I'd love to hear it!

    I'll be creating a GH repo (need to wait until I get home, as I can't do that from here). I suspect that will be the proper place to offer the code, since it's not really an addon to VF?

  • AdrianAdrian Wandering Spirit Montreal MVP
    edited January 2015

    @AaronWebstey‌ thanks for posting more details & thanks for sharing it -- Github is the right place :)

  • AaronWebsteyAaronWebstey Headband Afficionado Cole Harbour, NS ✭✭✭

    @Adrian‌ yes, perfect! I would love that. If you really feel like it, go ahead and pop it onto GH; otherwise I'll do it as soon as I get a chance.

  • AdrianAdrian Wandering Spirit Montreal MVP

    @AaronWebstey‌ I think you should add it when you have time. You deserve full credit.

    As for .org, I was thinking maybe with some tweaking and a settings page, it can be made to work with ones favorite community. I don't have time to look now, but I will hope to have some soon :D

  • AaronWebsteyAaronWebstey Headband Afficionado Cole Harbour, NS ✭✭✭

    @Adrian‌ yep, that's exactly what I'm hoping to do (or that someone will do :) ). The only challenge right now (other than taking the time to add the settings page and make the code use those settings) is getting the notification counts without installing my plugin.

    Ideally, I'd also make it easy for forum admins to download the code, customize with their own icon and site URL, and distribute the packaged plugin to their users as a download on their forum (which is what I did with mine).

  • hgtonighthgtonight ∞ · New Moderator

    @AaronWebstey‌ Thanks!

    I am working on a FF version right now. :)

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • hgtonighthgtonight ∞ · New Moderator

    You know, I was over-thinking this now that I looked at your code.

    The data you are looking for already exists on the profile controller, btw. Change your request to "http://forum.yoursite.com/profile.json".

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • AaronWebsteyAaronWebstey Headband Afficionado Cole Harbour, NS ✭✭✭

    Duh! Thanks @hgtonight‌ , that's exactly what I was looking for! Can't believe I didn't find that (and I did look).

  • AaronWebsteyAaronWebstey Headband Afficionado Cole Harbour, NS ✭✭✭

    FYI, I have created my GH repo here: https://github.com/webstey/Vanilla-ChromeNotifier

    I just can't create directories and upload code from here, so I'll do that later. But that's where you'll find the code soon :)

  • AaronWebsteyAaronWebstey Headband Afficionado Cole Harbour, NS ✭✭✭

    @hgtonight got installation instructions handy? I'll figure it out eventually, but it's not immediately obvious :)

  • hgtonighthgtonight ∞ · New Moderator

    @AaronWebstey I just threw up an XPI in the GitHub repo: https://github.com/hgtonight/Firefox-Vanilla-Notifier/tree/master/bin

    You can add that to your firefox through the cog wheel in your addons screen.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • AaronWebsteyAaronWebstey Headband Afficionado Cole Harbour, NS ✭✭✭

    Oh perfect!! Thanks!

  • AaronWebsteyAaronWebstey Headband Afficionado Cole Harbour, NS ✭✭✭

    Wow, yours is a lot cooler than mine :)

  • AaronWebsteyAaronWebstey Headband Afficionado Cole Harbour, NS ✭✭✭
    edited January 2015

    @hgtonight
    People are raving about your ff extension!

  • AaronWebsteyAaronWebstey Headband Afficionado Cole Harbour, NS ✭✭✭
Sign In or Register to comment.