Bookmark Kemono entries
< 腳本mark last read的回應
Here, retard.
(function() { 'use strict'; const currPath = window.location.pathname; const borderColor = "DarkOrange"; let markedButton = null; let markedElem = null; const markPost = (id, button, newTarget) => { if (markedButton) { markedButton.innerText = " "; markedElem.style.border = ""; } newTarget.style.border = `3px solid ${borderColor}`; button.innerText = "x"; markedButton = button; markedElem = newTarget; localStorage.setItem(currPath, id); }; const createButton = (id, cV) => { const button = document.createElement('button'); button.style.cssText = "position: absolute; top: 2px; right: 3px; z-index: 5; text-align: center; background-color: rgba(0, 0, 0, 0.2); color: Gold;"; button.innerText = id === localStorage.getItem(currPath) ? "x" : " "; button.addEventListener("click", (event) => { event.preventDefault(); markPost(id, button, cV.querySelector(`a`)); }); return button; }; document.querySelectorAll("article.post-card").forEach((cV) => { cV.style.position = "relative"; const button = createButton(cV.dataset.id, cV); const header = cV.querySelector('.post-card__header'); header.style.paddingRight = '30px'; header.appendChild(button); if (button.innerText === "x") { markedButton = button; markedElem = cV.querySelector(`a`); } }); const markedPost = document.querySelector(`[data-id='${localStorage.getItem(currPath)}']>a`); if (markedPost) { markedPost.style.border = `3px solid ${borderColor}`; } })();
Also use:
// @match https://kemono.su/*/user/*
Since we need this to work for fanbox also, etc.
登入以回復
Here, retard.
Also use:
Since we need this to work for fanbox also, etc.