Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name RemoveCommentsAndMentions
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description Удаляет комментарии Читателя1111 и комментарии с обращением к нему
- // @author Styx
- // @match https://fanfics.me/*
- // @grant none
- // ==/UserScript==
- (function(win, $) {
- 'use strict';
- const hideMentions = 0;
- const hideUIDs = [
- '56033',
- '202713',
- ];
- const re = /#(MessageCommentsNext|messagenextcomments)/;
- $(function() {
- function removeComments() {
- hideUIDs.forEach(function(uid) {
- const q = [
- `.MessageRightUser > span[data-show-member="${uid}"]`
- ];
- if (hideMentions) {
- q.push( `.MessageText a.user[href$="/user${uid}"]` );
- }
- $( q.join(', ') ).closest('table.Message').remove();
- });
- };
- win._php_success2 = win.php.success;
- win.php.success = function (_a, _b) {
- var _ = JSON.stringify(_a);
- if (re.test(_)) {
- setTimeout(removeComments, 1);
- }
- _php_success2(_a, _b);
- };
- removeComments();
- win.console.info(`RCaM: remove comments ${hideMentions?'and mentions ':''}of ${hideUIDs.length} user${hideUIDs.length!=1?'s':''}`);
- });
- })(window, jQuery);
Advertisement
Add Comment
Please, Sign In to add comment