Skip to content

Commit

Permalink
Merge pull request #1835 from D-Rekk/player-sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
ImprovedTube authored Nov 16, 2023
2 parents 1c73d3d + 7c6e2e9 commit ab15e84
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js&css/web-accessible/www.youtube.com/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ ImprovedTube.playerFitToWinButton = function () {
opacity: 0.85,
position: "right",
onclick: function () {
let previousSize = ImprovedTube.storage.player_size === "fit_to_window" ? "do_not_change" : ImprovedTube.storage.player_size;
let previousSize = ImprovedTube.storage.player_size === "fit_to_window" ? "do_not_change" : (ImprovedTube.storage.player_size ?? "do_not_change");
let isFTW = document.querySelector("html").getAttribute("it-player-size") === "fit_to_window"
if (isFTW) {
document.querySelector("html").setAttribute("it-player-size", previousSize);
Expand All @@ -702,9 +702,9 @@ ImprovedTube.playerFitToWinButton = function () {
},
title: 'Fit To Window'
});
} else if (this.elements.buttons['it-fit-to-win-player-button']) {
} else if (!this.storage.player_fit_to_win_button && this.elements.buttons['it-fit-to-win-player-button']) {
this.elements.buttons['it-fit-to-win-player-button'].remove();
document.querySelector("html").setAttribute("it-player-size", ImprovedTube.storage.player_size);
document.querySelector("html").setAttribute("it-player-size", ImprovedTube.storage.player_size ?? "do_not_change");
}
};
/*------------------------------------------------------------------------------
Expand Down

0 comments on commit ab15e84

Please sign in to comment.