Sleazy Fork is available in English.

Direct Image Link Booru.org

Показывает прямые ссылки под эскизами

  1. // ==UserScript==
  2. // @name Direct Image Link Booru.org
  3. // @version 2020.05.22
  4. // @description Показывает прямые ссылки под эскизами
  5. // @include http*://*booru.org*
  6. // @author Rainbow-Spike
  7. // @namespace https://greasyfork.org/users/7568
  8. // @homepage https://greasyfork.org/ru/users/7568-dr-yukon
  9. // @icon https://www.google.com/s2/favicons?domain=booru.org
  10. // @grant none
  11. // @run-at document-end
  12. // ==/UserScript==
  13.  
  14. if ( document.querySelector ( 'h1' ).innerHTML == '404 Not Found' ) window.close;
  15.  
  16. var img = document.querySelectorAll ( "div.thumb img" ),
  17. nlink, src, x;
  18.  
  19. if ( img.length > 0 ) {
  20. for ( x = 0; x < img.length; x++ ) {
  21. if ( img [ x ].getAttribute ( 'src' ) != null ) {
  22. src = img [ x ].getAttribute ( 'src' )
  23. //.split ( '?' ) [ 0 ]
  24. //.replace ( "thumbnails", "images" )
  25. //.replace ( "thumbnail_", "" )
  26. .replace ( "/img/", "/img/view/" )
  27. .replace ( "/thumb.", "." );
  28. nlink = document.createElement ( 'a' );
  29. nlink.setAttribute ( 'href', src );
  30. nlink.innerHTML = 'Link';
  31. nlink.style = 'background-color: black; border-radius: 5px; bottom: 26px; color: white; font-weight: bold; height: auto; padding: 2px 5px; position: relative; width: auto;';
  32. img [ x ].parentNode.appendChild ( nlink );
  33. }
  34. }
  35. }