diff --git a/js&css/extension/www.youtube.com/general/general.js b/js&css/extension/www.youtube.com/general/general.js index bc72419ae..d670616a8 100644 --- a/js&css/extension/www.youtube.com/general/general.js +++ b/js&css/extension/www.youtube.com/general/general.js @@ -220,7 +220,8 @@ extension.features.addScrollToTop = function (event) { extension.features.confirmationBeforeClosing = function () { window.onbeforeunload = function () { - if (extension.storage.get('confirmation_before_closing') === true) { + var video = document.querySelector('video'); + if (extension.storage.get('confirmation_before_closing') === true && !(video && video.ended)) { return 'You have attempted to leave this page. Are you sure?'; } };