PTH Copy last read link to icon

Copy the last read link to the read/unread/pinned/locked icon

  1. // ==UserScript==
  2. // @name PTH Copy last read link to icon
  3. // @version 0.2
  4. // @description Copy the last read link to the read/unread/pinned/locked icon
  5. // @author Chameleon
  6. // @include http*://redacted.ch/*
  7. // @grant none
  8. // @namespace https://greasyfork.org/users/87476
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. var lastreads=document.getElementsByClassName('last_read');
  15. for(var i=0; i<lastreads.length; i++)
  16. {
  17. var l=lastreads[i];
  18. var a=document.createElement('a');
  19. a.href=l.getElementsByTagName('a')[0].href;
  20. a.setAttribute('style', 'display: block; width: 10px; height: 15px;');
  21. l.parentNode.previousElementSibling.appendChild(a);
  22. }
  23.  
  24. })();