Skip to content
This repository has been archived by the owner on Apr 22, 2022. It is now read-only.

Add a Custom Service

saenzramiro edited this page Jul 5, 2016 · 10 revisions

How to add a Custom Service

  1. Be sure to be in the first tab of the app called Rambox Tab.
  2. At the top right corner of the Add a new Service section, click on the plus icon next to search field.
  3. Enter a name of the Service to display in the tab.
  4. Enter a URL for the service. Be sure the URL, when you aren't logged, shows a login form or if you are logged, shows the app.
  5. Enter a URL for the Logo of the service to display it in the tab.
  6. In Advanced option, there is an Unread Code field. This field you will use it if the service you are adding is not notifying an activity (new messages, new emails, etc) throw the title of the page (Ex. "(2) Facebook Messenger"). The number 2 means there are 2 messages unread. This code will be injected to the service page to run it (must return an Integer) and it will be embeded into this code:
function checkUnread() {
    updateBadge(_YOUR_CODE_WILL_BE_PLACED_HERE_);
}

function updateBadge(e) {
    e >= 1 ? document.title = "(" + e + ") " + originalTitle : document.title = originalTitle
}
var originalTitle = document.title;
setInterval(checkUnread, 3000);