Feedly 优化

一些优化

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

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

// 2024.07.12 批量标记已读时,若归档分类存在未读项,则先将其标记为已读。
// 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.批量标记已读时,先将归档分类的内容标记为已读。
    var clickMarkArchivesStr=`
    if(document.querySelector('div[aria-label^="Mark 存档"')){
        document.querySelector('div[aria-label^="Mark 存档"').click();
    }
    `.trim().split("\n").join();
    setInterval(() => {
        if(document.querySelector('div[aria-label^="Mark 存档"')){
            document.querySelectorAll('div[aria-label^="Mark "').forEach(ele=>{
                if(ele.onmousedown!=clickMarkArchivesStr){
                    ele.setAttribute('onmousedown',clickMarkArchivesStr);
                }
            })
        }
    }, 10000);


})(); //end all

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址