Skip to content

Commit

Permalink
Update functions.js click is always user_interacted
Browse files Browse the repository at this point in the history
  • Loading branch information
raszpl authored Jul 1, 2024
1 parent 8510b2c commit bd070e6
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions js&css/web-accessible/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,26 +421,13 @@ ImprovedTube.playerOnEnded = function (event) {
ImprovedTube.onkeydown = function () {
ImprovedTube.pauseWhileTypingOnYoutube()
window.addEventListener('keydown', function () {
if (ImprovedTube.elements.player && ImprovedTube.elements.player.classList.contains('ad-showing') === false) {
ImprovedTube.user_interacted = true;
}
ImprovedTube.user_interacted = true;
}, true);
};

ImprovedTube.onmousedown = function (event) {
window.addEventListener('mousedown', function (event) {
if (!ImprovedTube.user_interacted) {
setTimeout(function(){ImprovedTube.user_interacted = true},3000);
if (ImprovedTube.elements.player && ImprovedTube.elements.player.classList.contains('ad-showing') === false) {
var path = event.composedPath();
for (var i = 0, l = path.length; i < l; i++) {
if (path[i].className
// && path[i].className.indexOf
&& (/html5-(main-video|video-container)|ytp-play-button/.test(path[i].className))
) {ImprovedTube.user_interacted = true;}
}
}
}
ImprovedTube.onmousedown = function (event) {
window.addEventListener('mousedown', function (event) {
ImprovedTube.user_interacted = true;
}, true);
};

Expand Down

0 comments on commit bd070e6

Please sign in to comment.