iCloud favicons

Each service with his own favicon.

Installer dette script?
Skaberens foreslåede script

Du vil måske også kunne lide iCloud customizations

Installer som brugerstil
// ==UserScript==
// @name        iCloud favicons
// @description Each service with his own favicon.
// @namespace   https://gitlab.com/breatfr
// @match       https://*.icloud.com/*
// @version     1.0.0
// @homepageURL https://gitlab.com/breatfr/icloud
// @supportURL  https://discord.gg/Q8KSHzdBxs
// @author      BreatFR
// @copyright   2024, BreatFR (https://breat.fr)
// @grant       none
// @icon        https://www.icloud.com/system/icloud.com/2426Hotfix51/721bdfc3241b42114d62842854461ae7.png
// @license     BY-NC-ND; https://creativecommons.org/licenses/by-nc-nd/4.0/
// ==/UserScript==

(function() {
    'use strict';

    // Fonction pour changer le favicon avec un data URI
    function changeFavicon(dataUri) {
        // Supprimer tous les favicon existants
        var existingFavicons = document.querySelectorAll("link[rel*='icon']");
        existingFavicons.forEach(favicon => favicon.remove());

        // Créer un nouveau lien favicon
        var link = document.createElement('link');
        link.rel = 'icon';
        link.type = 'image/x-icon';
        link.href = dataUri;

        // Ajouter le nouveau favicon à l'en-tête du document
        document.head.appendChild(link);
    }

    // Fonction pour déterminer le service et changer le favicon
    function updateFavicon() {
        const id = window.location.href.includes('https://www.icloud.com/')
          ? window.location.pathname.split('/')[1]
          : '';

        if (id === 'calendar') {
            changeFavicon('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEYAAABGCAYAAABxLuKEAAAAAXNSR0IArs4c6QAAC/VJREFUeF7dnHtwVdUVh78DiBQVChggUCBARdAOGtF2pDOlSLEtzPAYGLG8LAZiIagQFFtBHBgUyogUTYjhGeRRhDoj1EcLBUo6RSjKw1eHYCtWAUMrEQwQBLObde45uefec869+5x7b5XumftHcvZea+3fXmvttdd+GGgUpVQjoDHQCugI3AjcAnQGWgPNgGuAJkBToKEG2XRW+RI4B9QAnwNngJPAB8B+4F3gX8CnwBeGYVxKxtxIVEEpdSXQCbgd+AmQCyoHDPm/T1FAQrKudsFbJOuW6/sF4ChwEHgNeB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CzkSIZu27dupnpTNdOQhI+WmIoLmCYlyxqO4Dhey1HBwJXHS0JQlH2aJR2ZvXXciRNtgIYEaSDTnGSipa0QgogBaKtVXkDMF5MSfKA/lf/hJYUnRW4Ft/gIGSIrJcg8j6E7N2s9b8s6ilNeBG1g+rguKXTvKKXRYWq9bjF2LrLorIFWH+vINmpqfB9CA9wMp6BKUcbuK8XW+Bko5iDwVgFjWMtJzC7ZPIn+O7NK8MSfCH3rYm/kG5LqZSSJwzmpeVdhxSg8W0ah44rtnQ21EfSft/hV55PGFhaI4oij13M+OrB0eyZVjVfD6f36IXMPKrWfCZFXhMS7zzI/UxKkGkquNpo9TM4Wa8W8kzKFuuZlDcTPpMSo4lKyU65vDJ0eT6s44+wTMn7wHpYxzAiIXVc0XmKKQeQTZofAzcD8rfrKaYgIx08EghC3VOdnE8xSTZhtzzNFOopJif5WqUaGe7Hu+RVIufjXXJiWX5yk1wnHEyPQUSoCHKSu5bVpvycj3e9qfN4V/xTTP8FkBB6Q9Ftv5IAAAAASUVORK5CYII=');
        } else if (id === 'contacts') {
            changeFavicon('https://www.icloud.com/system/icloud.com/2426Hotfix51/ebeab73c2a29818f9af9f846581e3548.png');
        } else if (id === 'find') {
            changeFavicon('https://www.icloud.com/system/icloud.com/2426Hotfix51/8f07873715a73121ce101e3ee4e09b67.png');
        } else if (id === 'iclouddrive') {
            changeFavicon('https://www.icloud.com/system/icloud.com/2426Hotfix51/721bdfc3241b42114d62842854461ae7.png');
        } else if (id === 'keynote') {
            changeFavicon('https://www.icloud.com/system/icloud.com/2426Hotfix51/dd963dca8eaf57df759dbda0c1e72d2a.png');
        } else if (id === 'mail') {
            changeFavicon('https://www.icloud.com/system/icloud.com/2426Hotfix51/17c4781c64e64e58b70a0e4c95a79a02.png');
        } else if (id === 'notes') {
            changeFavicon('https://www.icloud.com/system/icloud.com/2426Hotfix51/d54ad91bda4e227aab4fc06c9e23bcc8.png');
        } else if (id === 'numbers') {
            changeFavicon('https://www.icloud.com/system/icloud.com/2426Hotfix51/197229d0f30a0b31c7c089752788859e.png');
        } else if (id === 'pages') {
            changeFavicon('https://www.icloud.com/system/icloud.com/2426Hotfix51/34c81837e6653dd0b53c77e1b03e3b04.png');
        } else if (id === 'photos') {
            changeFavicon('https://www.icloud.com/system/icloud.com/2426Hotfix51/3d9f23365cbc27cd1ac7f1acc1b3f087.png');
        } else if (id === 'reminders') {
            changeFavicon('https://www.icloud.com/system/icloud.com/2426Hotfix51/2513d59bece66d7ed172e03a60ffbcb3.png');
        }
    }

    // Exécuter la mise à jour du favicon
    updateFavicon();

    // Observer les changements de page
    const observer = new MutationObserver(updateFavicon);
    observer.observe(document.body, {
        childList: true,
        subtree: true
    });
})();