Engoo expand all sentences

expand all sentences in engoo

// ==UserScript==
// @name            	Engoo expand all sentences
// @namespace       	https://greasyfork.org/users/821661
// @match           	https://engoo.com/app/lessons/*
// @grant           	none
// @version         	1.0
// @author          	hdyzen
// @description     	expand all sentences in engoo
// @license         	MIT
// ==/UserScript==
'use strict';

let init = false;
let interval = setInterval(e => {
    const showAll = document.querySelectorAll('[aria-label="Show all sentences"]');
    if (showAll.length) {
        showAll.forEach(element => {
            element.click();
            init = true;
        });
    }
    if (showAll.length === 0 && init) {
        clearInterval(interval);
    }
}, 200);