Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- +++
- @@ -5,12 +5,14 @@
- // @minFFVer 26
- // @namespace 4chan-X
- // @description Cross-browser userscript for maximum lurking on 4chan.
- // @license MIT; https://github.com/ccd0/4chan-x/blob/master/LICENSE
- // @include http://boards.4chan.org/*
- // @include https://boards.4chan.org/*
- +// @include http://boards.4channel.org/*
- +// @include https://boards.4channel.org/*
- // @include http://sys.4chan.org/*
- // @include https://sys.4chan.org/*
- // @include http://www.4chan.org/*
- // @include https://www.4chan.org/*
- // @include http://i.4cdn.org/*
- // @include https://i.4cdn.org/*
- @@ -524,13 +526,13 @@
- 'embedding.position': 'top: 50px; right: 0px;',
- 'thread-stats.position': 'bottom: 0px; right: 0px;',
- 'updater.position': 'bottom: 0px; left: 0px;',
- 'thread-watcher.position': 'top: 50px; left: 0px;',
- 'qr.position': 'top: 50px; right: 0px;'
- },
- - siteSoftware: "4chan.org yotsuba\n4cdn.org yotsuba"
- + siteSoftware: "4chan.org yotsuba\n4cdn.org yotsuba\n4channel.org yotsuba"
- };
- return Config;
- }).call(this);
- @@ -5686,13 +5688,13 @@
- $.on(d, '4chanXInitFinished', init);
- }
- DataBoard.prototype.initData = function(allData) {
- var base, name;
- this.allData = allData;
- - if (Site.hostname === '4chan.org' && this.allData.boards) {
- + if ((Site.hostname === '4chan.org' || Site.hostname === '4channel.org') && this.allData.boards) {
- return this.data = this.allData;
- } else {
- return this.data = ((base = this.allData)[name = Site.hostname] || (base[name] = {
- boards: {}
- }));
- }
- @@ -7357,33 +7359,33 @@
- },
- xpath: {
- thread: 'div[contains(concat(" ",@class," ")," thread ")]',
- postContainer: 'div[contains(@class,"postContainer")]'
- },
- regexp: {
- - quotelink: /^https?:\/\/boards\.4chan\.org\/+([^\/]+)\/+thread\/+(\d+)(?:[\/?][^#]*)?(?:#p(\d+))?$/
- + quotelink: /^https?:\/\/boards\.4chan(?:nel)?\.org\/+([^\/]+)\/+thread\/+(\d+)(?:[\/?][^#]*)?(?:#p(\d+))?$/
- },
- bgColoredEl: function() {
- return $.el('div', {
- className: 'reply'
- });
- },
- isThisPageLegit: function() {
- var ref;
- - 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');
- + 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');
- },
- is404: function() {
- var ref;
- return ((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found') || (g.VIEW === 'thread' && $('.board') && !$('.opContainer'));
- },
- isIncomplete: function() {
- var ref;
- return ((ref = g.VIEW) === 'index' || ref === 'thread') && !$('.board + *');
- },
- isAuxiliaryPage: function() {
- - return location.hostname !== 'boards.4chan.org';
- + return location.hostname !== 'boards.4chan.org' && location.hostname !== 'boards.4channel.org';
- },
- scriptData: function() {
- var j, len, ref, script;
- ref = $$('script:not([src])', d.head);
- for (j = 0, len = ref.length; j < len; j++) {
- script = ref[j];
- @@ -9638,13 +9640,13 @@
- className: 'external'
- });
- return a;
- }
- boardID = t.split('-')[0];
- if (boardID === 'current') {
- - if (location.hostname === 'boards.4chan.org') {
- + if (location.hostname === 'boards.4chan.org' || location.hostname === 'boards.4channel.org') {
- boardID = g.BOARD.ID;
- } else {
- a = $.el('a', {
- href: "/" + g.BOARD.ID + "/",
- textContent: text || g.BOARD.ID,
- className: 'current'
- @@ -9688,13 +9690,13 @@
- } else {
- return a.firstChild;
- }
- }
- if (Conf['JSON Index'] && indexOptions) {
- a.dataset.indexOptions = indexOptions;
- - if (a.hostname === 'boards.4chan.org' && a.pathname.split('/')[2] === '') {
- + if ((a.hostname === 'boards.4chan.org' || a.hostname === 'boards.4channel.org') && a.pathname.split('/')[2] === '') {
- a.href += (a.hash ? '/' : '#') + indexOptions;
- }
- }
- if (/-archive/.test(t)) {
- if (href = Redirect.to('board', {
- boardID: boardID
- @@ -16574,13 +16576,13 @@
- },
- node: function() {
- var a, i, len, m, ref;
- ref = $$('a', this.nodes.comment);
- for (i = 0, len = ref.length; i < len; i++) {
- a = ref[i];
- - if (m = a.href.match(/^https?:\/\/boards\.4chan\.org\/([^\/]+)\/catalog(#s=.*)?/)) {
- + if (m = a.href.match(/^https?:\/\/boards\.4chan(?:nel)?\.org\/([^\/]+)\/catalog(#s=.*)?/)) {
- a.href = "//boards.4chan.org/" + m[1] + "/" + (m[2] || '#catalog');
- }
- }
- },
- toggle: function() {
- $.event('CloseMenu');
- @@ -16599,29 +16601,29 @@
- if (!(((ref = CatalogLinks.enabled) != null ? ref : Conf['Catalog Links']) && list)) {
- return;
- }
- ref1 = $$('a:not([data-only])', list);
- for (i = 0, len = ref1.length; i < len; i++) {
- a = ref1[i];
- - 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')) {
- + 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')) {
- continue;
- }
- a.href = Conf['Header catalog links'] ? CatalogLinks.catalog(board) : "//boards.4chan.org/" + board + "/";
- - if (a.dataset.indexOptions && a.hostname === 'boards.4chan.org' && a.pathname.split('/')[2] === '') {
- + if (a.dataset.indexOptions && (a.hostname === 'boards.4chan.org' || a.hostname === 'boards.4channel.org') && a.pathname.split('/')[2] === '') {
- a.href += (a.hash ? '/' : '#') + a.dataset.indexOptions;
- }
- }
- },
- catalog: function(board) {
- if (board == null) {
- board = g.BOARD.ID;
- }
- 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')) {
- return "//catalog.neet.tv/" + board + "/";
- } else if (Conf['JSON Index'] && Conf['Use 4chan X Catalog']) {
- - if (location.hostname === 'boards.4chan.org' && g.BOARD.ID === board && g.VIEW === 'index') {
- + if ((location.hostname === 'boards.4chan.org' || location.hostname === 'boards.4channel.org') && g.BOARD.ID === board && g.VIEW === 'index') {
- return '#catalog';
- } else {
- return "//boards.4chan.org/" + board + "/#catalog";
- }
- } else {
- return "//boards.4chan.org/" + board + "/catalog";
- @@ -16629,13 +16631,13 @@
- },
- index: function(board) {
- if (board == null) {
- board = g.BOARD.ID;
- }
- if (Conf['JSON Index'] && board !== 'f') {
- - if (location.hostname === 'boards.4chan.org' && g.BOARD.ID === board && g.VIEW === 'index') {
- + if ((location.hostname === 'boards.4chan.org' || location.hostname === 'boards.4channel.org') && g.BOARD.ID === board && g.VIEW === 'index') {
- return '#index';
- } else {
- return "//boards.4chan.org/" + board + "/#index";
- }
- } else {
- return "//boards.4chan.org/" + board + "/";
- @@ -20913,13 +20915,13 @@
- }
- if (Conf['Force Noscript Captcha'] && Main.jsEnabled) {
- $.ready(Captcha.replace.noscript);
- return;
- }
- if (Conf['captchaLanguage'].trim() || Conf['Captcha Fixes']) {
- - if (location.hostname === 'boards.4chan.org') {
- + if (location.hostname === 'boards.4chan.org' || location.hostname === 'boards.4channel.org') {
- return $.onExists(doc, '#captchaFormPart', function(node) {
- return $.onExists(node, 'iframe', Captcha.replace.iframe);
- });
- } else {
- return $.onExists(doc, 'iframe', Captcha.replace.iframe);
- }
- @@ -24387,13 +24389,13 @@
- },
- parseArchivelink: function(link) {
- var boardID, m, postID, threadID;
- if (!(m = link.pathname.match(/^\/([^\/]+)\/thread\/S?(\d+)\/?$/))) {
- return;
- }
- - if (link.hostname === 'boards.4chan.org') {
- + if (link.hostname === 'boards.4chan.org' || link.hostname === 'boards.4channel.org') {
- return;
- }
- boardID = m[1];
- threadID = m[2];
- postID = link.hash.match(/^#[pq]?(\d+)$|$/)[1] || threadID;
- if (Redirect.to('post', {
- @@ -24564,13 +24566,13 @@
- flatten(key, val);
- }
- } else {
- Conf[parent] = obj;
- }
- };
- - if (location.hostname === 'boards.4chan.org') {
- + if (location.hostname === 'boards.4chan.org' || location.hostname === 'boards.4channel.org') {
- $.global(function() {
- var fromCharCode0;
- fromCharCode0 = String.fromCharCode;
- return String.fromCharCode = function() {
- if (document.body) {
- String.fromCharCode = fromCharCode0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement