clockify / browser-extension

Clockify Browser Extension
https://clockify.me/chrome-time-tracking
BSD 3-Clause "New" or "Revised" License
183 stars 172 forks source link

Outlook email integration #258

Open diogosfs opened 8 months ago

diogosfs commented 8 months ago

Would be really useful to have a Outlook integration similar to Gmail's. The outlook.js does not seem to work. At least not for the most recent outlook. I was able to get something with the following additions:

integrations.json:

    "outlook.office365.com": {
        "name": "Outlook Mail",
        "link": "*://outlook.office365.com/*",
        "script": "outlook-mail.js"
    },

outlook-mail.js:

// Inbox emails
clockifyButton.render(
    'div[class="MByod XxeQL"]:not(.clockify)',
    { observe: true },
    function (elem) {
        const description = $('[aria-label="Reading Pane"] [role="heading"]')
        link = clockifyButton.createButton(description.textContent);
        link.style.marginLeft = '20px';
        link.style.fontSize = '14px';
        elem.appendChild(link);
    }
);

This is not pretty but worked for me. I imagine 'div[class="MByod XxeQL"]:not(.clockify)' is not the best, seems like this could change.

I imagine one of you guys could implement a better solution within minutes. I would appreciate that and I am sure many others would to!