[AO3] Mark for Later - Skip the Click

Adds a button to listed works to mark them for later without needing to open the work first.

目前为 2023-10-24 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name [AO3] Mark for Later - Skip the Click
  3. // @namespace https://greasyfork.org/en/users/1138163-dreambones
  4. // @version 0.8
  5. // @description Adds a button to listed works to mark them for later without needing to open the work first.
  6. // @author DREAMBONES
  7. // @match http*://archiveofourown.org/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=archiveofourown.org
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. var domainRe = /https?:\/\/archiveofourown\.org\/(works|tags|users).*/i;
  17. if (domainRe.test(document.URL)) {
  18. var worksList = document.querySelectorAll("ol.work.index.group, ul.index.group, #user-series > ol.index.group");
  19. for (let section of worksList) {
  20. for (let work of section.children) {
  21. let heading = work.querySelector("h4.heading");
  22. let container = work.querySelector("p.datetime");
  23. let button = document.createElement("a");
  24. button.innerHTML = "⏲";
  25. button.href = `${heading.firstElementChild.href}/mark_for_later`;
  26. //button.target = "_blank";
  27. button.title = "Mark for Later";
  28. button.style.borderBottom = "none";
  29. button.style.paddingLeft = "0.5em";
  30. button.style.fontSize = "2em";
  31. button.style.verticalAlign = "middle";
  32. container.append(button);
  33. }
  34. }
  35. }
  36. })();