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.0
  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/wg/thread/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. // #######REQUIRES "4chan json Image Viewer" for full use.
  12.  
  13. // FOR USE ON /wg/ threads Only.
  14. // -- keep up to date, may add ability to view other threads in the future.
  15.  
  16. (function() {
  17. 'use strict';
  18.  
  19.  
  20. var el ;
  21. // displays Thread number (Lower right corner)
  22. var dirhref = window.location.pathname.replace("/wg/thread/", "").split('/')[0]; // /wg/thread/7662864.json RETURNS Thread Number
  23.  
  24. el =`
  25. <div style="background:#eeeeee; position:fixed; bottom:0px; right:0px;">
  26. <a href="https://a.4cdn.org/wg/thread/`+dirhref+`.json" target="_blank">
  27. <h1>ImgViewer</h1>
  28. </a>
  29. </div>`;
  30.  
  31. //ADDS el to PAGE
  32. document.body.innerHTML += el;
  33. })();