Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ImprovedTube committed Apr 3, 2023
1 parent 746a27b commit 2428298
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions js&css/web-accessible/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ new MutationObserver(function (mutationList) {
});

ImprovedTube.init = function () {
ImprovedTube.pageType();


window.addEventListener('yt-page-data-updated', function () {
ImprovedTube.pageType();
});

var yt_player_updated = function () {
document.dispatchEvent(new CustomEvent('improvedtube-player-loaded'));
Expand All @@ -60,7 +62,11 @@ ImprovedTube.init = function () {
this.onkeydown();
this.onmousedown();
this.youtubeLanguage();


if (ImprovedTube.elements.player && ImprovedTube.elements.player.setPlaybackRate) {
ImprovedTube.videoPageUpdate();
ImprovedTube.initPlayer();
}

if (window.matchMedia) {
document.documentElement.dataset.systemColorScheme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
Expand Down

0 comments on commit 2428298

Please sign in to comment.