Sleazy Fork is available in English.

antizapret.info links

Adds hyperlinks to the blocked pages for your very important browsing purposes

질문, 리뷰하거나, 이 스크립트를 신고하세요.
  1. // ==UserScript==
  2. // @name antizapret.info links
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.19
  5. // @description Adds hyperlinks to the blocked pages for your very important browsing purposes
  6. // @author 紫
  7. // @match https://antizapret.info/
  8. // @match https://antizapret.info/?*
  9. // @match https://antizapret.info/org.php*
  10. // @match https://antizapret.info/minjust.php*
  11. // @grant GM_xmlhttpRequest
  12. // ==/UserScript==
  13.  
  14. // jshint esversion: 6
  15. (function() {
  16. 'use strict';
  17.  
  18. // function section
  19.  
  20. const replaceWildcard = s => /\*\..+/.exec(s) ? s.replace(/\*\.(.+)/, "$1") : s;
  21. const replaceNoDomain = (url, ip) => url.includes("только ip") ? ip : url;
  22.  
  23. const extSiteLink = (link_url, link_ip) => {
  24. let link_node, img_node;
  25.  
  26. img_node = document.createElement('img');
  27. img_node.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFZJREFUeF59z4EJADEIQ1F36k7u5E7ZKXeUQPACJ3wK7UNokVxVk9kHnQH7bY9hbDyDhNXgjpRLqFlo4M2GgfyJHhjq8V4agfrgPQX3JtJQGbofmCHgA/nAKks+JAjFAAAAAElFTkSuQmCC';
  28. link_node = document.createElement('a');
  29. link_node.style.marginRight = '5px';
  30. link_node.href = 'http://';
  31.  
  32. if (link_url.length >= 40) {
  33. new GM_xmlhttpRequest({
  34. method: 'GET',
  35. url: `http://api.${location.host}/get.php?type=json&item=${encodeURIComponent(link_url)}`,
  36. onload(response) {
  37. link_node.href = JSON.parse(response.responseText).register[0].url;
  38. }
  39. });
  40. } else {
  41. link_node.href = 'http://' + replaceWildcard(replaceNoDomain(link_url, link_ip));
  42. }
  43.  
  44. link_node.target = '_blank';
  45. link_node.appendChild(img_node);
  46.  
  47. return link_node;
  48. };
  49.  
  50. // executed code section
  51.  
  52. let trs = document.getElementsByTagName('tbody')[0].getElementsByTagName('tr');
  53.  
  54. for (let tr of trs) {
  55. let linkTd = tr.getElementsByTagName('td')[1];
  56. let linkField = linkTd.getElementsByTagName('a')[0];
  57.  
  58. let ipTd = tr.getElementsByTagName('td')[2];
  59. let ipField = ipTd.getElementsByTagName('a')[0];
  60.  
  61. linkTd.insertBefore(extSiteLink(linkField.text, ipField.text), linkField);
  62. }
  63. })();