您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
let you know if the link is clicked before
- // ==UserScript==
- // @name Visited Links Highlighter
- // @namespace https://jirehlov.com
- // @version 0.1.2
- // @description let you know if the link is clicked before
- // @author Jirehlov
- // @match https://bgm.tv/*
- // @match https://chii.in/*
- // @match https://bangumi.tv/*
- // @license MIT
- // ==/UserScript==
- (() => {
- "use strict";
- const visitedLinks = JSON.parse(localStorage.getItem("JvCSS")) || {};
- const links = document.getElementsByTagName("a");
- for (let link of links) {
- const href = link.href;
- const linkColor = window.getComputedStyle(link).color;
- if ((linkColor === "rgb(46, 166, 255)" || linkColor === "rgb(0, 132, 180)") && !link.querySelector("span") && href !== "javascript:void(0);") {
- if (visitedLinks[href]) {
- link.style.color = "#c58af9";
- } else {
- link.addEventListener("click", function (event) {
- visitedLinks[this.href] = true;
- localStorage.setItem("JvCSS", JSON.stringify(visitedLinks));
- });
- }
- }
- }
- })();