您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds mark for later buttons to work index pages.
// ==UserScript== // @name ao3 mark for later // @description Adds mark for later buttons to work index pages. // @namespace ao3 // @match http*://archiveofourown.org/*works* // @match http*://archiveofourown.org/*bookmarks* // @match http*://archiveofourown.org/series/* // @match http*://archiveofourown.org/*readings* // @match http*://archiveofourown.org/collections* // @match http*://archiveofourown.org/users/* // @exclude http*://archiveofourown.org/*readings?*show=to-read* // @grant none // @version 1.2 // ==/UserScript== (function () { const blurbs = Array.from(document.querySelectorAll('li.blurb')); if (!blurbs.length) { return; } const style = document.createElement('style'); style.innerHTML = ` .blurb .mark { right: 0.5em; white-space: nowrap; test-align: center; clear: none; float: left; } @media only screen and (min-width: 800px) { .blurb .mark { right: 7em; top: 0.5em; } } `; document.head.appendChild(style); blurbs.forEach(blurb => { let workId; let notAO3; try { const titleLink = blurb.querySelector('.header.module .heading a'); workId = (titleLink.href.match(/\/works\/(\d+)\b/) || [])[1]; notAO3 = (titleLink.href.match(/archiveofourown.org/)||[]); } catch (ex) { } if (!workId || !notAO3[0]) { console.log('[ao3 mark for later] - skipping blurb that isn\'t a work blurb: ', blurb); return; } let section = blurb.querySelector('.actions') console.log(!section) if(!section) { section = blurb } section.innerHTML += ` <div class="mark"> <ul class="actions" role="menu"> <li> <a href=https://archiveofourown.org/works/${workId}/mark_for_later>Mark for Later</a> </li> </ul> </div> `; }); })();