# Make StackOverflow Explode (bookmarklet) [closed]

Sometimes people get frustrated on the StackExchange network (specifically SO).

Your task is to create a bookmarklet that causes StackOverflow to explode/implode/destroy in some fashion. This will provide a nicer way of dispersing our frustrations.

The Rules:

• it must be in the form of a bookmarklet
• must work in Chrome and Firefox (latest stable)
• jQuery is on the site, so you can use it
• no creating a script tag that pulls explosionThisPage.js or similar

Scoring is the number of characters that need to be copied and pasted, except:

• -1 if you include an explanation
• -5 for each upvote
• -10 if you don't use jQuery
• -10 if it makes an explosion sound
• +9e72 if it actually does harm to the site (F5 should repair the damage)

If the gif's distracting, remove it.

## closed as unclear what you're asking by Justin, Martin Ender, NinjaBearMonkey, Wrzlprmft, user16402 Nov 1 '14 at 20:06

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• IMO the spec isn't sharp enough for an objective determination of whether a submission meets it. – Peter Taylor Aug 20 '13 at 12:33
• in a comment, as it's not mine: javascript: varwww_WHAK_com = 'http://www.is-a-jerk.com/flash/url.asp?flash=10&insult=off&destroy=' + encodeURIComponent(top.location.href.replace('http://', '').replace('https://', '')); top.location.href = www_WHAK_com; void(0); – SeanC Aug 20 '13 at 13:20
• My comment wasn't about the scoring system but about the task specification. – Peter Taylor Aug 20 '13 at 14:57
• Really? That should be minus 9*10**72 points if it actually manages to cause harm to the site, and then repair it when the user reloads the page. That would be quite a feat. – Blacklight Shining Feb 10 '14 at 11:41
• @FakeRainBrigand IMO, causing real harm to the site that is somehow repaired upon reloading is far more impressive than simply causing harm to the site. – Blacklight Shining Feb 11 '14 at 16:43

Chicken!

### Score: 46 - 1 (explanation) - 5*17 (votes) = -40

javascript:$('*:not(:has(*))').text('chicken')  It simply takes every element with no children and replaces it with the text 'chicken'. Sample screenshots: more chicken this question chickenified • Awesome idea :-) It's also interesting to see things like "answered chicken" or the page title, which have non-chicken words... Why? – Brigand Oct 14 '13 at 20:19 • @FakeRainBrigand Huh? The page title becomes "chicken" for me... – Doorknob Oct 14 '13 at 20:32 • Longer but more thorough version, partially based on my entry: javascript:void($(':not(iframe,script,style)').contents().each(function(){if(this.nodeType==3)this.nodeValue=this.nodeValue.replace(/\w+/g,'chicken')})) – Ilmari Karonen Dec 13 '13 at 17:30
• @Doorknob, congrats, you had a score of 15, which was the lowest (sorry it took me so long to accept one). If I could do it over again, though, I'd make a vote worth -15, though. – Brigand Feb 11 '14 at 15:34
• Should have been HODOR! – SztupY Feb 15 '14 at 21:31

Here's my entry, which I'll call the drunkenator:

javascript:void(setInterval(function(){c='1234567890poiuytrewqasdfghjklmnbvcxzZXCVBNMLKJHGFDSAQWERTYUIOP=)(/&%25$%23"!1';$(':not(iframe,script,style)').contents().each(function(){if(this.nodeType==3&&/\S/.test(this.nodeValue)){a=this.nodeValue.split('');x=0;for(i=0;i<a.length;i++){r=Math.random()*9999;if(r<10){x=1;j=c.indexOf(a[i]);a[i]=(r<4%3F(t=a[i-1],a[i-1]=a[i],t):r<5%3F'':r<6%3Fa[i]+a[i]:j<0%3Fa[i]:c.charAt(j+(r<8%3F1:-1)))}}if(x)this.nodeValue=a.join('')}})},100))


At 474 chars, it's probably not going to win any golf prizes, but I'm hoping to make up for it in upvotes. :)

Here's the same code de-obfuscated:

setInterval(function () {
var c = '1234567890poiuytrewqasdfghjklmnbvcxzZXCVBNMLKJHGFDSAQWERTYUIOP=)(/&%$#"!1';$(':not(iframe,script,style)').contents().each(function () {
if (this.nodeType==3 && /\S/.test(this.nodeValue)) {
var a = this.nodeValue.split('');
var x = 0;
for (i = 0; i < a.length; i++) {
r = Math.random() * 9999;
if (r < 10) {
x = 1;
j = c.indexOf(a[i]);
a[i] = ( r < 4 ? (t = a[i-1], a[i-1] = a[i], t)
: r < 5 ? ''
: r < 6 ? a[i] + a[i]
: j < 0 ? a[i] : c.charAt(j + (r < 8 ? 1 : -1)) );
}
}
if (x) this.nodeValue = a.join('');
}
});
}, 100);


What it does is randomly mutate the text on the page, swapping adjacent characters, deleting or duplicating characters or replacing them with ones adjacent to them on the keyboard. The effect is kind of subtle at first, but leave it running for a while, and the page content will inevitably decay into a mess of drunken typing:

Ps. The code isn't in any way SO-specific, so it'll work on any website that uses jQuery. Try it on Wikipedia for hilarious results. The idea is based on something I wrote years ago as a creative interpretation of the "99 bottles of beer" challenge: my version introduced a slowly increasing number of typos into each verse, until the last ones were all but unrecognizable. If anyone wants to see it, here's the original Perl code.

• More lide the Dyslexinator (sorru, i'm typping while it's ruqning) – TheDoctor Feb 15 '14 at 23:37

I don't know why this was downvoted, I like it :)

This isn't the shortest, but I think it's pretty:

133 chars -1

javascript:(function(){setInterval(function(){$("div, span").eq(Math.round(Math.random()*$("div, span").length)).hide(500)},90)}());


Ungolfed:

javascript:(function(){
window.setInterval(function() {
i = Math.round(Math.random() * $("div, span").length);$("div, span").eq(i).hide("slow");
} , 90);
}());


Explanation: I hope this counts, this script implodes the site instead of exploding it ;) This just picks a random div or span every 90ms and closes it slowly..

• +1 but the random() isn't efficient for a full and controlled destroy, anyway I like it :) – Daniele Brugnara Oct 17 '13 at 12:28
• Just threw it into the URL window, and nothing's happened,,,? – WallyWest Dec 16 '13 at 0:22
• Sorry Wally, didn't see your comment. You need to save it as a bookmark. – Fels Feb 12 '14 at 8:44

Because it was not defined if the higher or lower score wins...

var t = $(this); t.css({ position: 'relative' }); t.delay(r()*10000).animate({ left: r() * 9e3 - 4e3, top: r() * 9e3 - 4e3 }, 555); });  It of course could be shortened by removing some of the tags, but let me know if there are any ways to shorten it without reducing the performance. # 181 151 chars - 1 (explanation) - 10 (no jQuery) = 140 points javascript:i=setInterval(function(){for(var a=document;0!==a.childNodes.length;)a=a.childNodes[a.childNodes.length-1];a!==document?a.parentNode.removeChild(a):clearInterval(i)},50);  A few more characters can be saved by omiting the function(){ and using a string instead. Also note the extraction of commonly used properties, e.g., c='childNodes allows us to do z[c] instead of z.childNodes. javascript:h=setInterval('d=z=document;c="childNodes";for(l="length";z[c][l];z=z[c][z[c][l]-1]);z!=d?z.parentNode.removeChild(z):clearInterval(h)',50);  I guess I could make less points by using jQuery and not traversing properties, but oh well. Ungolfed: var intervalHandle = setInterval(function() { var lastElement = document; //get last element while (lastElement.childNodes.length !== 0) { lastElement = lastElement.childNodes[lastElement.childNodes.length - 1]; } if(lastElement !== document) { lastElement.parentNode.removeChild(lastElement); } else { clearInterval(intervalHandle); } }, 50);  Basically this finds the latest DOM element on the page and removes it. Then keeps doing that for every 50 milliseconds, which I found to be a kind-of-average nice speed to see a page getting ripped from the ground up. It's therapeutic, I swear it. Disclaimer: I had made this some time ago and decided to share it, since it seems appropriate here. The source is at my GitHub repository. • This is great! I edited it to include a more-golfed version that saves a few characters. I hope you don't mind. It's functionally identical. – Brigand Aug 27 '13 at 15:25 • @FakeRainBrigand Not at all, thanks! In fact, you helped me learn some new cool tricks, which was my original intention when writing it. Thanks again! – Alpha Aug 27 '13 at 18:11 ### Javascript, 281 javascript:$('body').html().split('<code>javascript:').forEach(function (a) {if (a.indexOf("location")*a.indexOf("write")*a.indexOf("noscript")==-1) try{exec(a.split("</code>")[0].replace(/&#(\d+)/g, function(match, dec) {return String.fromCharCode(dec);}))} catch (e) {}});void 0;


It gets every response to the question in the form of <code>javascript:(stuff)</code> that doesn't change the location, and runs all of them.

• Hmm... I can see lots of whitespace that appears to be removable. Perhaps you should remove it. – John Dvorak Dec 11 '13 at 7:38
• I am pretty sure this fails the rule: "no creating a script tag that pulls explosionThisPage.js or similar". Also, it doesn't work on every SO page, just this one. Also, it does real damage on questions asking about XSS, so you should add 9e72 to your score. – John Dvorak Dec 11 '13 at 7:42

I like this effect. It basically toggles a slide effect for every div on the site every 1 millisecond.

javascript:setInterval(function(){$('div').toggle()},1)  Score 56 -1 Explanation -------------- 55 Total  • Nice, but just toogle would work too: javascript:setInterval(function(){$('div').toggle(88)},1) – Fels Aug 20 '13 at 19:56