diff --git a/src/content/ChatWatcher.js b/src/content/ChatWatcher.js index 1cba59b..1c1c441 100644 --- a/src/content/ChatWatcher.js +++ b/src/content/ChatWatcher.js @@ -6,8 +6,6 @@ import PersistentSyncStorage from 'src/helpers/PersistentSyncStorage'; class ChatWatcher { - - constructor() { this.watchChat = this.watchChat.bind(this); this._chatContainer = null; @@ -26,7 +24,6 @@ class ChatWatcher { }); } - getChatContainer() { // Parent of actual chat (children are messages) const checkForContainer = (res, rej) => { diff --git a/src/content/Message.js b/src/content/Message.js index 1c36d6b..2d2d429 100644 --- a/src/content/Message.js +++ b/src/content/Message.js @@ -102,16 +102,6 @@ class Message { /////////////////////////////////////////////////////////////////// - // Welcome Banner - var welcomBanner = document.querySelector("yt-live-chat-viewer-engagement-message-renderer"); - - // Set Hide Welcome Banner - if (PersistentSyncStorage.data.options.hideWelcomBanner) { - welcomBanner.classList.add("hideElement"); - } - - /////////////////////////////////////////////////////////////////// - // Checks for kappa and replaces emoji element with kappa if(PersistentSyncStorage.data.options.kappaFix) { @@ -168,7 +158,6 @@ class Message { inputAreaLabel.innerText = ""; }); - /////////////////////////////////////////////////////////////////// // Set Font Size @@ -245,6 +234,4 @@ class Message { }// end Message - - export default Message; \ No newline at end of file diff --git a/src/content/index.js b/src/content/index.js index 755258c..6f604da 100644 --- a/src/content/index.js +++ b/src/content/index.js @@ -3,7 +3,6 @@ import ChatScroller from "./ChatScroller"; import ChatWatcher from "./ChatWatcher"; import RouteWatcher from "./RouteWatcher"; - import { isLivestream, isYoutubeGaming, isYoutubeEmbed, isYoutubeVanilla, @@ -34,7 +33,6 @@ class Main { // chatframe id - chatframe // movieframe id - movie_player_fix // dono ticker id - ticker - // player-theater-container } @@ -58,22 +56,17 @@ class Main { } }// end onRouteChange - init() { + setDefaults() { - this.chatWatcher = new ChatWatcher(); - this.chatWatcher.init(); - this.chatScroller = new ChatScroller(); - this.chatScroller.init(); + /////////////////////////////////////////////////////////////////// - setDefaults(); - console.log("INIT"); + // Welcome Banner + var welcomBanner = document.querySelector("yt-live-chat-viewer-engagement-message-renderer"); - }// end init - -}// end main - - - function setDefaults() { + // Set Hide Welcome Banner + if (PersistentSyncStorage.data.options.hideWelcomBanner) { + welcomBanner.classList.add("hideElement"); + } /////////////////////////////////////////////////////////////////// @@ -85,15 +78,26 @@ class Main { } /////////////////////////////////////////////////////////////////// - } + init() { + + this.chatWatcher = new ChatWatcher(); + this.chatWatcher.init(); + this.chatScroller = new ChatScroller(); + this.chatScroller.init(); + + this.setDefaults(); + console.log("INIT"); + + }// end init +}// end main + // --- Every Frame Loaded PersistentSyncStorage.on("ready", () => { MAIN = new Main(); }); - function checkMode(){ if(alreadyTheater){ @@ -120,7 +124,6 @@ function enterTheaterMode() { const masthead_container = document.getElementById('masthead-container'); - masthead_container.hidden = true; theater_wrapper.classList.add('theater_wrapper_fix'); @@ -128,7 +131,6 @@ function enterTheaterMode() { chat_frame.classList.add('chat_frame_fix'); info_frame.classList.add('info_contents_fix'); - theater_wrapper.append(info_frame); theater_wrapper.append(movie_player); theater_wrapper.append(chat_frame); @@ -152,7 +154,6 @@ function exitTheaterMode(){ const masthead_container = document.getElementById('masthead-container'); - masthead_container.hidden = false; theater_wrapper.classList.remove('theater_wrapper_fix'); @@ -174,7 +175,6 @@ function theaterMode(){ if(theaterButton){ - if(document.getElementById('player-theater-container').contains(document.getElementById('player-container'))){ // for when page loads first time - check is reversed after this