diff --git a/browser_ext/background.js b/browser_ext/background.js index 068866de..a87ca485 100644 --- a/browser_ext/background.js +++ b/browser_ext/background.js @@ -8,9 +8,6 @@ const ignoredPages = { "directory": true, }; -let popup = chrome.extension.getViews({type: "popup"})[0]; -popup.window.getElementById("status").innerHTML = "NaM"; - /// return channel name if it should contain a chat function matchChannelName(url) { if (!url) diff --git a/browser_ext/inject.js b/browser_ext/inject.js index 29d13281..7d36ae7a 100644 --- a/browser_ext/inject.js +++ b/browser_ext/inject.js @@ -73,12 +73,21 @@ } // nav bar - if (rightCollapseButton && !installedObjects.topNav) { - let x = findRightCollapse(); + if (!installedObjects.topNav) { + if (rightCollapseButton) { + let x = findNavBar(); - installedObjects.topNav = true; - } else { - retry = true; + x.addEventListener("mouseup", () => { + if (!isCollapsed) { + let collapse = findRightCollapse(); + collapse.click(); + } + }); + + installedObjects.topNav = true; + } else { + retry = true; + } } // retry if needed