Skip to content

Commit

Permalink
fix: do not attempt to insert custom controls on pages that do not ha…
Browse files Browse the repository at this point in the history
…ve a video element
  • Loading branch information
rthaut committed Oct 15, 2024
1 parent 7a6ffbe commit 41fe004
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/scripts/content/YouTubeCustomControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ export const InsertControlsAndWatch = async () => {
export const InsertControls = async () => {
console.group("[YouTubeCustomControls] InsertControls()");

InsertPopoutEntryIntoContextMenu();
await InsertPopoutButtonIntoPlayerControls();
await InsertRotationButtonsIntoPlayerControls();
if (document.querySelector("video")) {
InsertPopoutEntryIntoContextMenu();
await InsertPopoutButtonIntoPlayerControls();
await InsertRotationButtonsIntoPlayerControls();
}
};

/**
Expand Down

0 comments on commit 41fe004

Please sign in to comment.