FloyedToo / Asana remove Upgrade

// ==UserScript==
// @name           Asana remove Upgrade
// @description    Removes clutter from asana
// @version        1.7
// @author         FloyedToo
// @namespace      FloyedToo
// @copyright      2018, FloyedToo (https://openuserjs.org/users/FloyedToo)
// @downloadURL https://openuserjs.org/install/FloyedToo/Asana_remove_Upgrade.user.js
// @updateURL      https://openuserjs.org/meta/FloyedToo/Asana_remove_Upgrade.meta.js
// @match          http://app.asana.com/*
// @match          https://app.asana.com/*
// @run-at         document-idle
// @license MIT
// ==/UserScript==

function sleep(ms) {
  return new Promise(resolve => setTimeout(resolve, ms));
}

function remove(element) {
    try {
        element.parentNode.removeChild(element);
    }
    catch (e) {
        // intentionally do nothing
    }
}

sleep(2000).then(() => {
    remove(document.getElementsByClassName('TopbarContingentUpgradeButton-link')[0]);
    remove(document.getElementsByClassName('SidebarTopNavLinks-myPortfoliosbutton')[0]);
    remove(document.getElementsByClassName('SidebarTopNavLinks-goalsButton')[0]);
    remove(document.getElementsByClassName('SidebarInvite Sidebar-stickyInvite')[0]);
    remove(document.getElementsByClassName('SidebarFavoritesAndMore-favoritesEmptyState')[0]);
    remove(document.getElementsByClassName('Sidebar-cleanAndClearFeedbackSection')[0]);
    remove(document.getElementsByClassName('Sidebar-cleanAndClearInviteAndHelpSection')[0]);

    var emptySpace = document.getElementsByClassName('CustomScrollbarScrollable-content')[0];
    emptySpace.Style.paddingBottom = 0;
});