Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2018
1,492
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 10.51 KB | None | 0 0
  1. ---
  2. +++
  3. @@ -5,12 +5,14 @@
  4.  // @minFFVer     26
  5.  // @namespace    4chan-X
  6.  // @description  Cross-browser userscript for maximum lurking on 4chan.
  7.  // @license      MIT; https://github.com/ccd0/4chan-x/blob/master/LICENSE
  8.  // @include      http://boards.4chan.org/*
  9.  // @include      https://boards.4chan.org/*
  10. +// @include      http://boards.4channel.org/*
  11. +// @include      https://boards.4channel.org/*
  12.  // @include      http://sys.4chan.org/*
  13.  // @include      https://sys.4chan.org/*
  14.  // @include      http://www.4chan.org/*
  15.  // @include      https://www.4chan.org/*
  16.  // @include      http://i.4cdn.org/*
  17.  // @include      https://i.4cdn.org/*
  18. @@ -524,13 +526,13 @@
  19.        'embedding.position': 'top: 50px; right: 0px;',
  20.        'thread-stats.position': 'bottom: 0px; right: 0px;',
  21.        'updater.position': 'bottom: 0px; left: 0px;',
  22.        'thread-watcher.position': 'top: 50px; left: 0px;',
  23.        'qr.position': 'top: 50px; right: 0px;'
  24.      },
  25. -    siteSoftware: "4chan.org yotsuba\n4cdn.org yotsuba"
  26. +    siteSoftware: "4chan.org yotsuba\n4cdn.org yotsuba\n4channel.org yotsuba"
  27.    };
  28.  
  29.    return Config;
  30.  
  31.  }).call(this);
  32.  
  33. @@ -5686,13 +5688,13 @@
  34.        $.on(d, '4chanXInitFinished', init);
  35.      }
  36.  
  37.      DataBoard.prototype.initData = function(allData) {
  38.        var base, name;
  39.        this.allData = allData;
  40. -      if (Site.hostname === '4chan.org' && this.allData.boards) {
  41. +      if ((Site.hostname === '4chan.org' || Site.hostname === '4channel.org') && this.allData.boards) {
  42.          return this.data = this.allData;
  43.        } else {
  44.          return this.data = ((base = this.allData)[name = Site.hostname] || (base[name] = {
  45.            boards: {}
  46.          }));
  47.        }
  48. @@ -7357,33 +7359,33 @@
  49.      },
  50.      xpath: {
  51.        thread: 'div[contains(concat(" ",@class," ")," thread ")]',
  52.        postContainer: 'div[contains(@class,"postContainer")]'
  53.      },
  54.      regexp: {
  55. -      quotelink: /^https?:\/\/boards\.4chan\.org\/+([^\/]+)\/+thread\/+(\d+)(?:[\/?][^#]*)?(?:#p(\d+))?$/
  56. +      quotelink: /^https?:\/\/boards\.4chan(?:nel)?\.org\/+([^\/]+)\/+thread\/+(\d+)(?:[\/?][^#]*)?(?:#p(\d+))?$/
  57.      },
  58.      bgColoredEl: function() {
  59.        return $.el('div', {
  60.          className: 'reply'
  61.        });
  62.      },
  63.      isThisPageLegit: function() {
  64.        var ref;
  65. -      return location.hostname === 'boards.4chan.org' && d.doctype && !$('link[href*="favicon-status.ico"]', d.head) && ((ref = d.title) !== '4chan - Temporarily Offline' && ref !== '4chan - Error' && ref !== '504 Gateway Time-out' && ref !== 'MathJax Equation Source');
  66. +      return (location.hostname === 'boards.4chan.org' || location.hostname === 'boards.4channel.org') && d.doctype && !$('link[href*="favicon-status.ico"]', d.head) && ((ref = d.title) !== '4chan - Temporarily Offline' && ref !== '4chan - Error' && ref !== '504 Gateway Time-out' && ref !== 'MathJax Equation Source');
  67.      },
  68.      is404: function() {
  69.        var ref;
  70.        return ((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found') || (g.VIEW === 'thread' && $('.board') && !$('.opContainer'));
  71.      },
  72.      isIncomplete: function() {
  73.        var ref;
  74.        return ((ref = g.VIEW) === 'index' || ref === 'thread') && !$('.board + *');
  75.      },
  76.      isAuxiliaryPage: function() {
  77. -      return location.hostname !== 'boards.4chan.org';
  78. +      return location.hostname !== 'boards.4chan.org' && location.hostname !== 'boards.4channel.org';
  79.      },
  80.      scriptData: function() {
  81.        var j, len, ref, script;
  82.        ref = $$('script:not([src])', d.head);
  83.        for (j = 0, len = ref.length; j < len; j++) {
  84.          script = ref[j];
  85. @@ -9638,13 +9640,13 @@
  86.            className: 'external'
  87.          });
  88.          return a;
  89.        }
  90.        boardID = t.split('-')[0];
  91.        if (boardID === 'current') {
  92. -        if (location.hostname === 'boards.4chan.org') {
  93. +        if (location.hostname === 'boards.4chan.org' || location.hostname === 'boards.4channel.org') {
  94.            boardID = g.BOARD.ID;
  95.          } else {
  96.            a = $.el('a', {
  97.              href: "/" + g.BOARD.ID + "/",
  98.              textContent: text || g.BOARD.ID,
  99.              className: 'current'
  100. @@ -9688,13 +9690,13 @@
  101.          } else {
  102.            return a.firstChild;
  103.          }
  104.        }
  105.        if (Conf['JSON Index'] && indexOptions) {
  106.          a.dataset.indexOptions = indexOptions;
  107. -        if (a.hostname === 'boards.4chan.org' && a.pathname.split('/')[2] === '') {
  108. +        if ((a.hostname === 'boards.4chan.org' || a.hostname === 'boards.4channel.org') && a.pathname.split('/')[2] === '') {
  109.            a.href += (a.hash ? '/' : '#') + indexOptions;
  110.          }
  111.        }
  112.        if (/-archive/.test(t)) {
  113.          if (href = Redirect.to('board', {
  114.            boardID: boardID
  115. @@ -16574,13 +16576,13 @@
  116.      },
  117.      node: function() {
  118.        var a, i, len, m, ref;
  119.        ref = $$('a', this.nodes.comment);
  120.        for (i = 0, len = ref.length; i < len; i++) {
  121.          a = ref[i];
  122. -        if (m = a.href.match(/^https?:\/\/boards\.4chan\.org\/([^\/]+)\/catalog(#s=.*)?/)) {
  123. +        if (m = a.href.match(/^https?:\/\/boards\.4chan(?:nel)?\.org\/([^\/]+)\/catalog(#s=.*)?/)) {
  124.            a.href = "//boards.4chan.org/" + m[1] + "/" + (m[2] || '#catalog');
  125.          }
  126.        }
  127.      },
  128.      toggle: function() {
  129.        $.event('CloseMenu');
  130. @@ -16599,29 +16601,29 @@
  131.        if (!(((ref = CatalogLinks.enabled) != null ? ref : Conf['Catalog Links']) && list)) {
  132.          return;
  133.        }
  134.        ref1 = $$('a:not([data-only])', list);
  135.        for (i = 0, len = ref1.length; i < len; i++) {
  136.          a = ref1[i];
  137. -        if (((ref2 = a.hostname) !== 'boards.4chan.org' && ref2 !== 'catalog.neet.tv') || !(board = a.pathname.split('/')[1]) || (board === 'f' || board === 'status' || board === '4chan') || a.pathname.split('/')[2] === 'archive' || $.hasClass(a, 'external')) {
  138. +        if ((((ref2 = a.hostname) !== 'boards.4chan.org' || ref2 === 'boards.4channel.org') && ref2 !== 'catalog.neet.tv') || !(board = a.pathname.split('/')[1]) || (board === 'f' || board === 'status' || board === '4chan') || a.pathname.split('/')[2] === 'archive' || $.hasClass(a, 'external')) {
  139.            continue;
  140.          }
  141.          a.href = Conf['Header catalog links'] ? CatalogLinks.catalog(board) : "//boards.4chan.org/" + board + "/";
  142. -        if (a.dataset.indexOptions && a.hostname === 'boards.4chan.org' && a.pathname.split('/')[2] === '') {
  143. +        if (a.dataset.indexOptions && (a.hostname === 'boards.4chan.org' || a.hostname === 'boards.4channel.org') && a.pathname.split('/')[2] === '') {
  144.            a.href += (a.hash ? '/' : '#') + a.dataset.indexOptions;
  145.          }
  146.        }
  147.      },
  148.      catalog: function(board) {
  149.        if (board == null) {
  150.          board = g.BOARD.ID;
  151.        }
  152.        if (Conf['External Catalog'] && (board === 'a' || board === 'c' || board === 'g' || board === 'biz' || board === 'k' || board === 'm' || board === 'o' || board === 'p' || board === 'v' || board === 'vg' || board === 'vr' || board === 'w' || board === 'wg' || board === 'cm' || board === '3' || board === 'adv' || board === 'an' || board === 'asp' || board === 'cgl' || board === 'ck' || board === 'co' || board === 'diy' || board === 'fa' || board === 'fit' || board === 'gd' || board === 'int' || board === 'jp' || board === 'lit' || board === 'mlp' || board === 'mu' || board === 'n' || board === 'out' || board === 'po' || board === 'sci' || board === 'sp' || board === 'tg' || board === 'toy' || board === 'trv' || board === 'tv' || board === 'vp' || board === 'wsg' || board === 'x' || board === 'f' || board === 'pol' || board === 's4s' || board === 'lgbt')) {
  153.          return "//catalog.neet.tv/" + board + "/";
  154.        } else if (Conf['JSON Index'] && Conf['Use 4chan X Catalog']) {
  155. -        if (location.hostname === 'boards.4chan.org' && g.BOARD.ID === board && g.VIEW === 'index') {
  156. +        if ((location.hostname === 'boards.4chan.org' || location.hostname === 'boards.4channel.org') && g.BOARD.ID === board && g.VIEW === 'index') {
  157.            return '#catalog';
  158.          } else {
  159.            return "//boards.4chan.org/" + board + "/#catalog";
  160.          }
  161.        } else {
  162.          return "//boards.4chan.org/" + board + "/catalog";
  163. @@ -16629,13 +16631,13 @@
  164.      },
  165.      index: function(board) {
  166.        if (board == null) {
  167.          board = g.BOARD.ID;
  168.        }
  169.        if (Conf['JSON Index'] && board !== 'f') {
  170. -        if (location.hostname === 'boards.4chan.org' && g.BOARD.ID === board && g.VIEW === 'index') {
  171. +        if ((location.hostname === 'boards.4chan.org' || location.hostname === 'boards.4channel.org') && g.BOARD.ID === board && g.VIEW === 'index') {
  172.            return '#index';
  173.          } else {
  174.            return "//boards.4chan.org/" + board + "/#index";
  175.          }
  176.        } else {
  177.          return "//boards.4chan.org/" + board + "/";
  178. @@ -20913,13 +20915,13 @@
  179.        }
  180.        if (Conf['Force Noscript Captcha'] && Main.jsEnabled) {
  181.          $.ready(Captcha.replace.noscript);
  182.          return;
  183.        }
  184.        if (Conf['captchaLanguage'].trim() || Conf['Captcha Fixes']) {
  185. -        if (location.hostname === 'boards.4chan.org') {
  186. +        if (location.hostname === 'boards.4chan.org' || location.hostname === 'boards.4channel.org') {
  187.            return $.onExists(doc, '#captchaFormPart', function(node) {
  188.              return $.onExists(node, 'iframe', Captcha.replace.iframe);
  189.            });
  190.          } else {
  191.            return $.onExists(doc, 'iframe', Captcha.replace.iframe);
  192.          }
  193. @@ -24387,13 +24389,13 @@
  194.      },
  195.      parseArchivelink: function(link) {
  196.        var boardID, m, postID, threadID;
  197.        if (!(m = link.pathname.match(/^\/([^\/]+)\/thread\/S?(\d+)\/?$/))) {
  198.          return;
  199.        }
  200. -      if (link.hostname === 'boards.4chan.org') {
  201. +      if (link.hostname === 'boards.4chan.org' || link.hostname === 'boards.4channel.org') {
  202.          return;
  203.        }
  204.        boardID = m[1];
  205.        threadID = m[2];
  206.        postID = link.hash.match(/^#[pq]?(\d+)$|$/)[1] || threadID;
  207.        if (Redirect.to('post', {
  208. @@ -24564,13 +24566,13 @@
  209.              flatten(key, val);
  210.            }
  211.          } else {
  212.            Conf[parent] = obj;
  213.          }
  214.        };
  215. -      if (location.hostname === 'boards.4chan.org') {
  216. +      if (location.hostname === 'boards.4chan.org' || location.hostname === 'boards.4channel.org') {
  217.          $.global(function() {
  218.            var fromCharCode0;
  219.            fromCharCode0 = String.fromCharCode;
  220.            return String.fromCharCode = function() {
  221.              if (document.body) {
  222.                String.fromCharCode = fromCharCode0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement