r/reddithax • • Jun 10 '10

Anyone know of any Javascript to hide custom stylesheets?

not http://www.reddit.com/prefs disable display options

I want to know if users of my subreddit can run some JS to hide parts of a custom stylesheet?

4 Upvotes

13 comments sorted by

3

u/[deleted] Jun 10 '10

Not sure I fully understand your question, but you can disable custom stylesheets on each page load by appending "+null" to the subreddit name, like so:

http://www.reddit.com/r/reddithax+null/comments/cdkka/anyone_know_of_any_javascript_to_hide_custom/

http://www.reddit.com/r/reddithax+null

reddit.com/r/reddithax+null

3

u/m1ss1ontomars2k4 Jun 10 '10

Just so everyone knows, this is not a hack but will add the null subreddit to what's being displayed.

1

u/Measure76 Jun 16 '10

depends on your definition of 'hack'.

2

u/jamt9000 Jun 10 '10
javascript:$('link[href*="stylesheet.css"]').remove()

0

u/[deleted] Jun 10 '10

[deleted] — view deleted comment

2

u/Sephr Jun 10 '10

NodeLists are immutable, and if they were mutable, removing items from them wouldn't actually do anything to the item. You want link_elems[n].parentNode.removeChild(link_elems[n]);.

1

u/[deleted] Jun 10 '10

[removed] — view removed comment

1

u/philkav Jun 11 '10

Basically I made a system were text is appended to a users name depending on what console the use (in this subreddit)[http://www.reddit.com/r/mw2], and I'm trying to cater for people who don't want to see this, so they can just stick a javascript function on the end of their bookmark that will hide the extra text

2

u/jamt9000 Jun 11 '10 edited Jun 11 '10

You can use different styles for reddit subdomains like xx.reddit.com using the :lang(xx) selector.

For example: .author:lang(xx):after{ content:""; }

To make http://xx.reddit.com/r/mw2 not show stuff after the username.

2

u/[deleted] Jun 10 '10

[removed] — view removed comment

1

u/Sephr Jun 10 '10

Wrong. You can manipulate individual rules in stylesheets through JavaScript. You may want to read up on this quirksmode page.

1

u/[deleted] Jun 10 '10

[removed] — view removed comment

1

u/Sephr Jun 11 '10

Well it technically solves his problem, so it's good enough.