Works great!

This discussion is related to the Notificator addon.

This is so cool!
I actually remember reading the thread where this idea came up some time ago, but I thought everyone forgot about this.

The design of this plugin opens up many possibilities, for example one could use the HTML5 notifications API to send InformMessages as desktop notifications like NodeBB does
https://developer.mozilla.org/en-US/docs/Web/API/notification

I get a TypeError: response.InformMessages is undefined (but that could be because I was testing it on 2.2)

My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations

Comments

  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    I hope I haven't mixed up anything! I still don't like JavaScript and would never give a guarantee for even one single line of js code I write.

    Using the notification API is a great idea, but because of that lines

    if (notificationsPinging > 0 || !gdn.focused)
             return;
    

    new notifications are only polled if the window is on focus (which makes changing the favicon somewhat more useless to my opinion). And if the tab has focus, you do not need desktop notifications because you will see the standard garden notification.


  • You could fire an ajax request for notifications in the plugin or override pingForNotifications (maybe with longer intervals if the window is inactive).

    To prevent multiple tabs from pinging at the same time, you could save the timestamp in the browsers localStorage

    localStorage.setItem("lastPing", Date.now());
    

    This could also be used to synchronize the notification count across windows like facebook does

    localStorage.getItem("notificationCount");
    

    My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations

  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    Great additions! I see if I can work on it in the near future, but pull requests are welcome anytime! ;)


  • AaronWebsteyAaronWebstey Headband Afficionado Cole Harbour, NS ✭✭✭

    Can't wait to try this out this afternoon! Gives me an idea, which is to make a chrome extension that keeps a notification count, similarly to the gmail notifier ones :)

  • Notificator somehow "broke" my forum:
    http://www.spazioasperger.it/forum/
    I've installed it just for trying it out and the unistalled after I saw that the forum was not working properly but the effects didn't revert.
    Basically now emotify stopped working and the "notification-icons" on the page top are too big.
    If I go to a fresh browser (I usually use chrome, I went to mozilla) it's all ok, but I can't pretend that everyone in the forum change browser! Also I've tryed to erase the cache and it didn't worked.
    Any Idea?

  • Note: I just finished trying it out on different computers. It's not a matter of local cache. It's broken on all browsers (chrome, safari, iexplorer) except for firefox

  • Another note. I've tried different themes. It's all fine with the mobile theme, but also with MinusBaseline. So probably there is something called by the more complex themes that interact.

  • Notificator somehow "broke" my forum:
    http://www.spazioasperger.it/forum/
    I've installed it just for trying it out and the unistalled after I saw that the forum was not working properly but the effects didn't revert.
    Basically now emotify stopped working and the "notification-icons" on the page top are too big.
    If I go to a fresh browser (I usually use chrome, I went to mozilla) it's all ok, but I can't pretend that everyone in the forum change browser! Also I've tryed to erase the cache and it didn't worked.
    Any Idea?

  • Note: I just finished trying it out on different computers. It's not a matter of local cache. It's broken on all browsers (chrome, safari, iexplorer) except for firefox

  • Another note. I've tried different themes. It's all fine with the mobile theme, but also with MinusBaseline. So probably there is something called by the more complex themes that interact.

Sign In or Register to comment.