3

I use the element picker from uBlock Origin to hide distractions from Quora. The Top Stories from Your Feed section can be hid permanently. The element is:

##.top_stories_content_wrapper.first_content_page_feed.ContentWrapper 

However, any element in the header will show again after a refresh. The whole header is

###__w2_aBrjao6_header

Why can't the header be hid permanently? How to do this?

3

Quora seems to create a random ID for the header each page refresh. Mine currently is ###__w2_aBrjao6_header. The consistent parts are __w2_ and _header, but __w2_ is used in other elements, sadly.

So you can select the _header part and have uBlock Origin block that using the following (CSS) selectors:

##[id *= "_header"] /* Contains */
/* OR */
##[id $= "_header"] /* Ends in  */

The /* ... */ parts are just comments, don't include them when selecting elements in uBlock.

It seems that the first two ## are used by uBlock Origin as an identifier. We don't want the third because we aren't technically selecting a specific ID, we're selecting a type (but in reality that there is only one matching element per page).

The easiest way to add the rule is to start uBlock Origin on the page, select something with it's ink-dropper tool ("element picker mode"), then change the rule to one from above.

  • Why do they do this? Is that a kind of obfuscation? What does the number of # mean? I can't look it up anywhere. – Ooker Jun 6 '17 at 13:16
  • If possible, can you help me make a parser from these filters to userscript? Many thanks – Ooker Jun 7 '17 at 6:47
  • The only reason I can imagine why they'd include the random string is to deter people like us from hiding the elements. As for the number of #s, 2 are used to split between the hostname and element in userscripts. The third is just a CSS selector for a particular ID, which is why we don't need it for this case – Zach Saucier Jun 7 '17 at 13:40
  • 1
    I joined here just to upvote this answer. +1 Quora and all modern websites are indeed greedy, in most scenarios the header, footer, sidebar don't add any value to the reader. – nehemiah Sep 2 at 5:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.