Sort Facebook Messenger contacts by idle time
Normally I would suggest pulling up the functions. Though they get hoisted by JS, it's nice from a readability point of view that you know they exist first before code tries to use them.



// if chat sidebar found in any mutations
if (mutations.some(function(mutation) {


This is a huuuge if statement. You might want to consider pulling out that callback function. It doesn't use mutations anyways.



if (mutation.type === 'childList') {
    // return if any added element is the chat sidebar
    return Array.from(mutation.addedNodes).some(initFbChatSidebar);
  // check if class is changed in existing element
  } else {
    // return if changed element is the chat sidebar
    return initFbChatSidebar(mutation.target);
  }


Can be simplified into:

var isChildListMutation = mutation.type === 'childList';
return isChildListMutation  ? Array.from(mutation.addedNodes).some(initFbChatSidebar);
                            : initFbChatSidebar(mutation.target);




// start locating sidebar
exists.observe(document.body, { attributes: true, childList: true, subtree: true, attributeFilter: ['class'] });


Consider breaking the config into newlines. As a single line, it isn't really readable.



  Array.from(li).sort(function(la, lb) {
    // get offline times
    var a = getOfflineTime(la);
    var b = getOfflineTime(lb);

    // compare offline times
    return a - b;
  }).forEach(function(li) {
    // add list items to list in sorted order
    ul.appendChild(li);
  });


Consider appending to a document fragment instead of directly to the DOM. Only after you append every li to the fragment, append the fragment to the ul.



var num, unit;

num = +str.slice(0, -1);
unit = str.slice(-1);


Consider putting var on the assignment operation instead. Save an extra line. Additionally, your num is not guarded against NaN.