From 786d3eb445dfa601bcaca8ce7b5688d86a922377 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Wed, 9 Sep 2020 19:00:19 -0700 Subject: hotkeys.js: use DOMContentLoaded so images don't delay script Instead of the load event, which waits until all assets are finished loading in order for script to start. --- youtube/static/js/hotkeys.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'youtube/static/js/hotkeys.js') diff --git a/youtube/static/js/hotkeys.js b/youtube/static/js/hotkeys.js index 45e4333..c696ac0 100644 --- a/youtube/static/js/hotkeys.js +++ b/youtube/static/js/hotkeys.js @@ -27,6 +27,6 @@ function onKeyDown(e) { } } -window.addEventListener('load', function() { +window.addEventListener('DOMContentLoaded', function() { document.addEventListener('keydown', onKeyDown); -}); \ No newline at end of file +}); -- cgit v1.2.3