Feedly 优化

一些优化

当前为 2024-07-24 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Feedly 优化
// @namespace    https://feedly.com
// @version      2024.07.24
// @description  一些优化
// @author       Ejin
// @match        https://feedly.com/*
// @grant        none
// ==/UserScript==

// 2024.07.14 弱化存档分类的加粗,隐藏未读数。
// 2024.02.23 First-read,跳转到第一个已读项
(function() {
    'use strict';

	setInterval(()=>{//1.route

		// 1.1 First-read
		if(location.href.indexOf("feedly.com/i/subscription/feed") != -1){
			if(document.querySelector(".detail+.list-tags") != null
			&& document.querySelector(".detail+.list-tags").innerHTML.indexOf("First-read") == -1 ){
				document.querySelector(".detail+.list-tags").innerHTML += "<a href='javascript:;' id='First-read'>/First-read</a>";
				document.getElementById("First-read").addEventListener('click',()=>{
					var FunID=setInterval(()=>{//First-read Function
						document.getElementById("First-read").style.display="none";

						if(document.querySelector("html").getAttribute("FunURL") != null){
							if(document.querySelector("html").getAttribute("FunURL") != location.href){
								clearInterval(document.querySelector("html").getAttribute("FunID"));
								document.querySelector("html").removeAttribute("FunID");
								document.querySelector("html").removeAttribute("FunURL");
								return;
							}
						}

						if(document.querySelectorAll(".EntryTitle").length > 0){
							if(document.querySelectorAll(".EntryTitle--read").length==0){
								document.querySelectorAll(".EntryTitle")[document.querySelectorAll(".EntryTitle").length-1].scrollIntoView();
							} else {
								document.querySelectorAll(".EntryTitle--read")[0].scrollIntoView();
								clearInterval(document.querySelector("html").getAttribute("FunID"));
								document.querySelector("html").removeAttribute("FunID");
								document.querySelector("html").removeAttribute("FunURL");
							}
						}

					},1000);//setInterval
					document.querySelector("html").setAttribute("FunID",FunID);
					document.querySelector("html").setAttribute("FunURL",location.href);
				});
			}
		} //end 1.1

	},500);//end 1.route

    // 2.弱化存档分类的加粗,隐藏未读数。
    setInterval(() => {
        if(document.querySelector('div[aria-label^="Mark 存档"')){
            if(document.querySelector('div[aria-label^="Mark 存档"').style.opacity==""){
                // 寻找存档文件夹的最上层元素
                var parEle=document.querySelector('div[aria-label^="Mark 存档"');
                var parKey='<div id="user/';
                if(parEle.parentElement.innerHTML.split(parKey).length > 1){
                    parEle=parEle.parentElement;
                } else {
                    parEle=parEle.parentElement;
                    if(parEle.parentElement.innerHTML.split(parKey).length > 1){
                        parEle=parEle.parentElement;
                    } else {
                        parEle=parEle.parentElement;
                        if(parEle.parentElement.innerHTML.split(parKey).length > 1){
                            parEle=parEle.parentElement;
                        } else {
                            parEle=parEle.parentElement;
                            if(parEle.parentElement.innerHTML.split(parKey).length > 1){
                                parEle=parEle.parentElement;
                            } else {
                                parEle=parEle.parentElement;
                                if(parEle.parentElement.innerHTML.split(parKey).length > 1){
                                    parEle=parEle.parentElement;
                                } else {

                                }
                            }
                        }
                    }
                }

                //隐藏未读数
                parEle.onmouseover=()=>{
                    document.querySelector('div[aria-label^="Mark 存档"').style.opacity="1";
                };
                parEle.onmouseout=()=>{
                    document.querySelector('div[aria-label^="Mark 存档"').style.opacity="0.2";
                };
                parEle.onmouseout();

                //取消加粗
                document.querySelectorAll(".LeftnavListRow__text--bold").forEach(item=>{
                    if(item.innerHTML=="存档"){
                        item.className=item.className.replace("LeftnavListRow__text--bold","");
                    }
                });
            }
        }
    }, 10000);


})(); //end all