Display remaining Youtube playlist time

Displays the sum of the lengths of the remaining videos in a playlist

< Valutazione su Display remaining Youtube playlist time

Recensione: Male - lo script non funziona

§
Pubblicato: 06/03/2023

Does not work on qutebrowser, greasemonkey :/

DragosarusAutore
§
Pubblicato: 07/03/2023

When trying to fix this, I ran into two issues:

  • the operator ||= was not supported using the current (v2.5.3) standalone release (requires Qt 6 or QtWebEngine 5.15 if I understood it correctly)
  • jQuery did not seem to work. Perhaps the @require does not work.

While the first issue can easily be fixed, the second issue means that all jQuery code would need to be replaced with vanilla JS (which should be possible but I unfortunately do not have the time to do this at the moment).

The following workaround makes the script run properly for me using the current standalone Windows release without significant changes:

1. Change line 133 from

miniplayerActive ||= $(selectors.ytd_app)[0].hasAttribute(attr);

    to

miniplayerActive = miniplayerActive || $(selectors.ytd_app)[0].hasAttribute(attr);

2. Add the code under "JS Call" from https://joanpiedra.com/jquery/greasemonkey/ between lines 12 and 14.

3. Replace the URL in GM_JQ.src with the one next to @require (or make it https)

4. Replace the body of letsJQuery() with the anonymous function containing the script (i.e. everything from line 14 onwards):

function letsJQuery() {
    (function() {
    'use strict';
    ...
    })();
}

Pubblica risposta

Accedi per pubblicare una risposta.