window.__loadRecipe = function(p) {
    p.recipeGetSecondaryIcon = function(pad) {
        var url = window.getComputedStyle(
            document.querySelector(".gbii"), ':before'
        ).content;
        if (url === undefined || url.length < 10) {
            return "";
        }
        url = url.substring(5, url.length - 2);
        return url;
    }

    p.recipeGetTitle = function(pad) {
        var title = document.title
        var regs = title.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi)
        if (regs !== undefined && regs.length > 0) {
            return regs[0]
        }
        return title
    };

    p.recipeGetPassiveBadge = function(pad) {
        let messageCount = 0;
        let badgeElem = document.getElementsByClassName('bsU')[0];
        if (badgeElem !== undefined && badgeElem.previousSibling.firstChild.getAttribute("href").endsWith("#inbox")) {
            messageCount = parseInt(badgeElem.textContent);
            if (isNaN(messageCount)) {
                messageCount = 0;
            }
        }
        return messageCount;
    }
}