Skip to content

Instantly share code, notes, and snippets.

@rlemon
Last active February 6, 2022 04:59
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rlemon/4444273 to your computer and use it in GitHub Desktop.
Save rlemon/4444273 to your computer and use it in GitHub Desktop.
Malicious JS scripts (userscript hell) - NOTE: None of these scripts are actually malicious... just trolling and annoying. No bits will be harmed if you run these.
/* Rotates the page 180deg when the user hovers over the body.
Only works for webkit browsers */
(function() {
var s = document.createElement('style');
s.textContent = '.trololol:hover{-webkit-transform: rotate(180deg);';
document.head.appendChild(s);
document.body.classList.add('trololol');
}());
/* Makes forms unsubmitable
Then mocks you in the console like a little bitch... */
[].forEach.call(document.forms, function(form) {
form.onsubmit = function(e) { console.log('u mad bro?'); e.preventDefault(); return false; };
});
/* Simulated lag.
Setup for upto ten seconds of random lag, randomly, every zero to ten seconds. */
function lag(n/*seconds of lag*/) {
var now = new Date().getTime();
while( (new Date().getTime()) - now < n*1000 ) {}
}
function run() {
lag(Math.floor(Math.random()*10)+1);
setTimeout(run, Math.random()*10000);
}
run();
/* Changes background and foreground colours for all elements on the page */
function r() {
return Math.floor(Math.random() * 255);
}
function lemon() {
with(this.style) {
color = ['rgb(', [r(), r(), r()].join(','), ')'].join('');
backgroundColor = ['rgb(', [r(), r(), r()].join(','), ')'].join('');
}
}
function rocks() {
Array.prototype.forEach.call(document.all, function(item) {
setTimeout(function() {
lemon.call(item);
}, Math.random() * 100 + 100);
});
setTimeout(rocks, Math.random() * 500 + 100);
}
rocks();
/* Changes background and foreground colours for all elements on the page */
function r() { return Math.floor(Math.random() * 255); }
function fakk(){ this.style.color = ['rgb(',[r(),r(),r()].join(','),')'].join(''),
this.style.backgroundColor = ['rgb(',[r(),r(),r()].join(','),')'].join(''); }
[].forEach.call(document.all, function(item) {
setTimeout(function() {fakk.call(item)}, (Math.random()*500)+100)
});
@tyler200821
Copy link

like

count210

like count 2000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment