https://www.duolingo.com/iTyrion

Code to Remove League from web (without going to private)

```
var ln = document.evaluate("//h2[contains(text(),' League')]", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.parentNode.parentNode.parentNode ln.parentNode.removeChild(ln)

```

With GreaseMoneky (firefox) , TamperMonkey (chrome), create script and use this simple code, can remove the league panel from showing.

And I disabled duolingo app's notifications on my cellphone. -- Hope they can give an option to opt-out League only...

July 7, 2019

40 Comments
This discussion is locked.


https://www.duolingo.com/MooO0O

If I knew how to use GreaseMoneky or TamperMonkey, I would definitely use this. You should somehow put this information online so if someone searches "how to get rid of Duolingo Leagues" they can do it. It's easy to say "just ignore it" but it's distracting, and annoying, especially if you don't like it. I could ignore a mosquito, but I'd rather get rid of it. If they would make a "page" with a button to click and open the league, I wouldn't mind it so bad...I could ignore it, but it's lurking there on the top of my screen where statistics that I cared about used to be.

July 7, 2019

https://www.duolingo.com/Thomasco3

If you use Adblock Plus or uBlock Origin you can block the league panel and your stats box will return to its proper place.

July 8, 2019

https://www.duolingo.com/dogomolo

You should somehow put this information online

One option is to use SEO.

July 7, 2019

https://www.duolingo.com/SuperLearner007

Yea... this info is already online.

July 8, 2019

https://www.duolingo.com/FieryCat

Your code has the same problem as this one has: https://forum.duolingo.com/comment/32441298. In order to avoid this problem, you need to use MutationObserver or setInterval (that is worse). To what I have said there, I can add that both of the scripts will cause errors on those pages that do not have an element with the Leagues. At least you should add some checks into your code.

Note for everyone: these types of blocking do not exclude you from the Leagues, they just hide a widget of the Leagues from you. You will continue to get some League popup widgets and you will be seen in the Leagues by other users.

July 8, 2019

https://www.duolingo.com/Thomas.Heiss

Quote FieryCat: Just removing a div block after the page was loaded is not enough.
Try to go to (Practice/Profile/Dictionary) and go back: the leaderboard block will be displayed again.

Source: https://forum.duolingo.com/comment/32441298

I can confirm that I exactly run into this Home/Learn page reload problem with "uBlock Origin"; the panel/div is only hidden for the first (full) refresh, but not the subsequent (partly) reloads.

July 8, 2019

https://www.duolingo.com/emanandchill

Can't you just hide the div with the display property in css, and maybe a combo of js? I tried this and the box remains hidden when I go to profile and back to learn.

July 8, 2019

https://www.duolingo.com/FieryCat

If I had tackled this problem, I would have first rummaged through duolingo code to find out if there are any hidden settings for this. For example, I would try to pull this handle:

July 9, 2019

https://www.duolingo.com/St3amPunkGiraff3

What is the league panel??? I'm assuming that it's not good...

July 7, 2019

https://www.duolingo.com/MooO0O

you have assumed correctly

July 7, 2019

https://www.duolingo.com/David328228

It is the league leader board. On my laptop, I can't miss it, it's at the top right of the page when I click "learn". Can't help you with the app.

July 7, 2019

https://www.duolingo.com/testmoogle

If all it does is hide the leagues panel, wouldn't it be much simpler to create a userstyle rather than a userscript? Here's all I did:

/* Hide "Leagues" panel */
div._2ANgP.a5SW0 {display: none;}

/* Hide "Achievements" panel */
div._2SCNP._1E3L7 {display: none;}

None of the problems people mentioned below about errors or of it reappearing upon return to the page. ^^

July 8, 2019

https://www.duolingo.com/dlhgl

A quick explanation for all who are wondering about the code:

  • the first part of the code looks for the element within the page which contains the league widget
  • the second part removes the league widget so that it is not shown on your screen anymore.

It doesn't do anything else, especially it doesn't do any permanent change.

And as FieryCat already mentioned, you are still participating in a league and seen there by others, it is just that you don't see the league anymore.

Instead of using the code you could just put a peace of paper on that part of your screen which would do the same.

July 8, 2019

https://www.duolingo.com/GregBerg2

I never paid any attention to the leagues until I came back onto Duolingo after about a 6 month hiatus, and when I came back, was on the leaderboard and up in 3rd place, and within a couple of days I was number one. At that point, then the competition was on! I'm super competitive and will work day and night to win my league. I wonder where I was before the 6 month hiatus? No telling.

July 8, 2019

https://www.duolingo.com/Thomasco3

I wonder where I was before the 6 month hiatus?

They were not introduced until January:

https://forum.duolingo.com/comment/30433123/Leaderboards-now-on-all-Android-devices-updated

I know this because I have the DEC 2018 version of the APP installed on my phone, and it does not have leagues.

July 8, 2019

https://www.duolingo.com/Tat846374

Yes...works for me too...sometimes right up there...sometimes in the 20's.. but don't want to loose my Ruby ))

July 8, 2019

https://www.duolingo.com/Songve

Does that violate Guidelines?

July 7, 2019

https://www.duolingo.com/iTyrion

It's just for control the contents showed on my end, I don't think it violates anything. -- I don't even use adblock on Duolingo.
Anyway, if anyone found some rules or guidelines against this, please do tell me, thanks in advance :)

July 7, 2019

https://www.duolingo.com/Kelikaku

@iTyrion
Seems to me you're just adding
a custom script to your own personal
browser. That seems to be as innocent
as an add-on to change the screen to
nighttime mode or to alter the fonts.

If Duolingo objects to that it would be
quite odd! Good topic. Thanks for
posting this.

Keep up the good work!!
בס״ד

July 7, 2019

https://www.duolingo.com/iTyrion

Thanks, now I can be more confident :)

July 8, 2019

https://www.duolingo.com/ISpeakAlien

I don't even use adblock on Duolingo.

You should because of "features" like Leagues.

July 7, 2019

https://www.duolingo.com/dogomolo

@Songve

We don't know what that script does. I think mods should take some action and remove this post if they cannot review the code. If they can, then they should let us know that this script is honest.

July 7, 2019

https://www.duolingo.com/Thomas.Heiss

@dogomolo

You know, this applies to ALL userscripts for Duolingo, Memrise, etc. you can find on github and 3rd party script listing sites.

If you have any doubts, do not directly copy code or click the RAW button to auto install .JS code into Tampermonkey/Violentmonkey.

IMHO there is no need for a moderator to take care of a thread or delete it (I can not check / verify it right now, but I might try if time allows in the next weeks).

The better option might be to put working and tested code onto a code repository, so people who are interested just need to click the RAW button after displaying the source code.

Any Firefox addon or Chrome extension with hidden (binary) code could be more dangerous when you install it, even from the official browser repositories, as you can not directly check the code which was implemented.

Once we had a bigger security issue with the Stylish (not to be confused with the new OpenSource Stylus addon/extension) Firefox addon: https://forum.duolingo.com/comment/27870688/SECURITY-ISSUE-Warning-Stylish-addon-is-unsafe-contains-tracker-sends-collected-data

There was a very nasty default setting for the Stylish addon which I and many other people were not were aware of for a longer time.
It was removed from the official repositories but it looks like now the addon is back in store.

July 7, 2019

https://www.duolingo.com/FieryCat

I understand your concern, and I wanted to say that the current script implementation does exactly what @iTyrion wrote (except that the script does not remove the Leagues but hides them).

July 8, 2019

https://www.duolingo.com/iTyrion

Thanks for the clarification.
As a non-native English speaker, I didn't know the nuances in such case, now I learned this from you :)

July 8, 2019

https://www.duolingo.com/FieryCat

I'm Russian :)

July 8, 2019

https://www.duolingo.com/Linda7Italian

Why go to such lengths? Just ignore Leagues, simple.

July 7, 2019

https://www.duolingo.com/iTyrion

For some ppl, it's quite difficult to ignore something that's right beside you.

July 8, 2019

https://www.duolingo.com/logane616

Some people are overrun by the challenge of competition. Certainly I am, but not everyone is.

July 7, 2019

https://www.duolingo.com/LICA98

because they're attention seekers and can't ignore them

July 8, 2019

https://www.duolingo.com/iTyrion

Have you ever heard a thing called ADHD?
BTW, the whole lot of flags behind your name are quite Attention-drawing.

July 8, 2019

https://www.duolingo.com/chocochipkookie

Roasted

July 8, 2019
Learn a language in just 5 minutes a day. For free.