code-charity / youtube

[top~1 open YouTube & Video web-extension] Enrich your experience & choice! 🧰180+ options & clever features📌set+forget📌Longest-standing(been tough). Please join🧩us👨‍👩‍👧‍👧 ..⋮ {playback|content discovery|player|extra buttons|distractions|related videos|shorts|ads|quality|codec|full tab|full screen}
http://improvedtube.com
Other
3.42k stars 513 forks source link

Mini Player and Fit to Window not working. #2531

Open Korygauger opened 1 month ago

Korygauger commented 1 month ago

Bug Report:

The custom miniplayer is no longer working for some reason I can get it to work by toggling the setting for it but as soon as I refresh it stops working.

The Fit to Window button no longer shows up at all thus I can't even activate it. I assume it is working otherwise.

as for Fit to window it seems like it is a purely firefox issue I tried it on firefox base and mercury, not sure about other forks though. I imagine it is just install it on firefox activate the setting and see if it works.

clicking on the link for the error on the fit to window button brings me to this code snippet: line 804 in player.js

ImprovedTube.playerFitToWinButton = function () {
    if (this.storage.player_fit_to_win_button === true && (/watch\?/.test(location.href))) {
        let tempContainer = document.createElement("div");

        // Create a Trusted Type policy
        const policy = trustedTypes.createPolicy('default', {    // <- error on this line here on trusted types not defined
            createHTML: (string) => string,
        });

also brings me to line 285 in functions.js as well as line 140 in init.js

doesn't seem to be any errors pertaining to the miniplayer though.

doesn't matter if I am logged in or not.

I feel like the Fit to window bug should be relatively easy but I am sorry I couldn't be more help on the miniplayer.

OPTIONAL (usually): -->

Korygauger commented 1 month ago

an added note: the miniplayer setting persists until you do a full refresh so I am assuming that it might have something to do with when the setting is applied. It seems like the setting is applied properly when you toggle the setting but it doesn't on the initialization of the extension. This is just my best guess though.

SabalM commented 1 month ago

Before the latest update Fit to windows had stopped working on chromium browsers due to requiring use of trusted type policy, this is not required on non-chromium browsers like firefox. Latest update to the extension had fixed it for chromium browser but it does't work on firefox. I have a fix that could work but don't know how to test on firefox.

SabalM commented 1 month ago

Checked the code, few hours ago fix has been added already.

Korygauger commented 1 month ago

alright @SabalM is there a way to add that now while I wait for next months update?

SabalM commented 1 month ago

It would have been easy to do on chromium browsers. I'm not sure on firefox.

junvm commented 4 weeks ago

Piggybacking off this; so do we just have to wait for the next update for the fit to window feature to work on firefox?

Korygauger commented 3 weeks ago

by the way with the recent update fit to window is still not working due to a different error. svg is not defined.

this.createPlayerButton({
            id: 'it-fit-to-win-player-button',
            child: svg,      // <- right here
            opacity: 0.85,
            position: "right",
            onclick: function () {

this is on line 825 of player.js in the www.youtube.com directory of the repo