InoReader Colorful ListViewが機能しなくなったのでAIに代わりのスクリプトを書いてもらう

おま環かなー。
なんか急にInoReader Colorful ListViewが機能しなくなって視認性が低下して不便なので、ChatGPTにユーザースクリプト書いてもらいました。

// ==UserScript==
// @name         Inoreader Feed Auto Colorizer
// @version      1.0
// @description  フィードごとに自動で色分けして視認性を高める
// @author       Generated by ChatGPT (OpenAI)
// @match        https://*.inoreader.com/*
// @grant        none
// ==/UserScript==

// フィード取得元ごとに色を生成する関数
function hashStringToColor(str) {
    let hash = 0;
    for (let i = 0; i < str.length; i++) {
        hash = (hash << 5) - hash + str.charCodeAt(i);
    }
    // 色相、彩度、明度を調整して色を決める
    const color = `hsl(${hash % 360}, 60%, 85%)`; // 色相をハッシュ値から決定
    return color;
}

// 記事に色を適用する関数
function applyColors() {
    // 記事を取得
    document.querySelectorAll(".ar").forEach(item => {
        // 各記事の data-fid 属性を取得(フィード取得元ID)
        const feedId = item.getAttribute("data-fid");

        if (feedId) {
            // フィード取得元IDに基づいて色を生成
            const feedColor = hashStringToColor(feedId);

            // 記事の背景色を設定
            item.style.setProperty('background-color', feedColor, 'important');
        } else {
            // data-fid 属性がない場合はデフォルト色を適用
            item.style.setProperty('background-color', '#f0f0f0', 'important'); // デフォルト色
        }
    });
}

// ページの読み込みが完了したらapplyColors関数を実行
window.addEventListener('load', function() {
    // ページ内容が動的に更新される場合に備えて、MutationObserverを使ってリアルタイムで色を適用
    const observer = new MutationObserver(applyColors);
    observer.observe(document.body, {
        childList: true,
        subtree: true
    });
}); 

とりあえず自分の環境ではこれでまた色付けされるようになったので満足です。