Skip to content

Commit f0649df

Browse files
committed
Fix youtube connector
Restore the workaround to prevent scrobbling videos from background tabs.
1 parent 56dc529 commit f0649df

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/connectors/youtube.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,11 @@ Connector.isScrobblingAllowed = () => {
9999
return false;
100100
}
101101

102-
// FIXME: Workaround to prevent scrobbling the vidio opened in a background tab.
103-
// if (Connector.getCurrentTime() < 1) {
104-
// return false;
105-
// }
102+
// Workaround to prevent scrobbling the video opened in a background tab.
103+
const videoElement = document.querySelector(videoSelector);
104+
if (videoElement && videoElement.currentTime < 1) {
105+
return false;
106+
}
106107

107108
if (allowedCategories.length === 0) {
108109
return true;

0 commit comments

Comments
 (0)