Greasy Fork

Hide Duolingo 'SEND CONGRATS'

This is a simple script to get rid of a little annoyance on the Duolingo website, without compromising the site usability. The page uses the same container for both a useless "SEND CONGRATS" message and the access to the test that allows us to complete a unit without having to do every single exercise.

目前为 2021-05-16 提交的版本。查看 最新版本

// ==UserScript==
// @name     Hide Duolingo 'SEND CONGRATS' 
// @version  1
// @grant    none
// @match duolingo.com
// @description This is a simple script to get rid of a little annoyance on the Duolingo website, without compromising the site usability. The page uses the same container for both a useless "SEND CONGRATS" message and the access to the test that allows us to complete a unit without having to do every single exercise.
// @namespace https://greasyfork.org/users/772826
// ==/UserScript==

if (window.location.href=='https://www.duolingo.com/learn') {
	function checkThing() {
		var x = document.getElementsByClassName('_3gK3K _2At32 _1szh4');
		if (x.length>0) {
      console.log(x[0].innerText);
      if (x[0].innerHTML.indexOf('SEND CONGRATS') != -1) {
				console.log('v: ' + x[0].style.visibility);
				if (x[0].style.visibility=='hidden') {
					clearInterval(duoCheck);
					}
				x[0].style.visibility = "hidden";
				}
			}
		}
	const duoCheck = setInterval(checkThing, 1000);
	}