Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions PiPifier-Safari-Extension/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ function checkForVideo() {
}

function getVideo() {
if (location.hostname === "www.hulu.com") {
return document.getElementById('content-video-player');
}
return document.getElementsByTagName('video')[0];
}

Expand Down Expand Up @@ -76,7 +79,7 @@ function shouldAddYouTubeButton() {
|| document.getElementsByClassName("ytp-right-controls").length > 0)
&& document.getElementsByClassName('PiPifierButton').length == 0;
}

function addYouTubeButton() {
if (!shouldAddYouTubeButton()) return;
var button = document.createElement("button");
Expand All @@ -90,7 +93,7 @@ function addYouTubeButton() {
buttonImage.width = 22;
buttonImage.height = 36;
button.appendChild(buttonImage);

document.getElementsByClassName("ytp-right-controls")[0].appendChild(button);
}

Expand Down