Skip to content

Commit

Permalink
Revert "Revert "#1544 #1652 undoing 402d705 @dodieboy""
Browse files Browse the repository at this point in the history
This reverts commit 238ff1c.
  • Loading branch information
ImprovedTube committed Apr 4, 2023
1 parent dba30e5 commit e36bbcd
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 e36bbcd

Please sign in to comment.