4chan json Image Viewer - Thread Float Link

Float URL to View Thread using "4chan json Image Viewer" (https://greasyfork.org/en/scripts/418726-4chan-json-image-viewer)

目前为 2020-12-17 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name 4chan json Image Viewer - Thread Float Link
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0.1
  5. // @description Float URL to View Thread using "4chan json Image Viewer" (https://greasyfork.org/en/scripts/418726-4chan-json-image-viewer)
  6. // @author Czy [2020]
  7. // @match https://boards.4chan.org/*/thread/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. // #######REQUIRES "4chan json Image Viewer" for full use.
  12.  
  13. // -- keep up to date, may add New Functions in the future.
  14.  
  15. (function() {
  16. 'use strict';
  17.  
  18.  
  19. var el ;
  20. function dirco(a){ return window.location.pathname.split("/")[a]};
  21. // displays Thread number (Lower right corner)
  22. var dirhref = dirco(3); // thread number
  23. var dirthread = dirco(1); // thread name
  24.  
  25.  
  26. el =`
  27. <div style="background:#eeeeee; position:fixed; bottom:0px; right:0px;">
  28. <a href="https://a.4cdn.org/`+dirthread+`/thread/`+dirhref+`.json" target="_blank" onclick="window.close();">
  29. <h1>ImgViewer</h1>
  30. </a>
  31. </div>`;
  32.  
  33. //ADDS el to PAGE
  34. document.body.innerHTML += el;
  35. })();