Guest User

Untitled

a guest
Nov 28th, 2023
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         DJT Can Skip
  3. // @version      0.1
  4. // @description  Sample text
  5. // @match        https://boards.4channel.org/jp/*
  6. // @icon         https://www.google.com/s2/favicons?sz=64&domain=4channel.org
  7. // @grant        none
  8. // ==/UserScript==
  9.  
  10. (function() {
  11.     'use strict'
  12.     const THRESHOLD = 0.075
  13.  
  14.     if (!document.querySelector('.subject').textContent.includes('DJT')) return
  15.  
  16.     const a = Array.from(document.querySelectorAll('blockquote'))
  17.     const skip = a
  18.       .map(x => (x.textContent.match(/iq/ig) || []).length)
  19.       .reduce((acc, cur) => acc + cur) / a.length > THRESHOLD
  20.     if (skip) {
  21.       const msg = document.createElement('div')
  22.       msg.innerHTML = 'SKIP SKIP SKIP'
  23.       msg.style = 'color: red; font-size: 100px; position: fixed; top: 0; right: 0; width: 100vw; height: 100vh; display: flex; align-items: center; justify-content: center;'
  24.       document.body.append(msg)
  25.     }
  26. })();
Advertisement
Add Comment
Please, Sign In to add comment