diff --git a/js/content.js b/js/content.js index 74265fe..8272424 100644 --- a/js/content.js +++ b/js/content.js @@ -291,6 +291,39 @@ if (typeof window === 'object') { }; const iframePipeline = createPipeline(); + + /* + const observablePromise = (proc, timeoutPromise) => { + let promise = null; + return { + obtain() { + if (!promise) { + promise = new Promise(resolve => { + let mo = null; + const f = () => { + let t = proc(); + if (t) { + mo.disconnect(); + mo.takeRecords(); + mo = null; + resolve(t); + } + } + mo = new MutationObserver(f); + mo.observe(document, { subtree: true, childList: true }) + f(); + timeoutPromise && timeoutPromise.then(() => { + resolve(null) + }); + }); + } + return promise + } + } + } + */ + + //if (!$) return; /** @@ -8047,6 +8080,22 @@ yt-update-unseen-notification-count yt-viewport-scanned yt-visibility-refresh } + // added in 2024.07.05 + // see https://greasyfork.org/scripts/428651/discussions/250256 + const notWaitingRoom = () => { + + // https://www.youtube.com/watch?v=fDL2UhbysVk + // live waiting room: dont hide for chat$live + + if (!formatDates) { + return true; // assumption based + } + + if (formatDates && formatDates.broadcastBeginAt && !formatDates.broadcastEndAt && formatDates.isLiveNow === false) return false; + + return true; + } + const dpeChatRefreshCounter = ControllerID(); // let proceedingChatFrameVideoID = ''; // let newVideoPageCACC = -1; @@ -8159,7 +8208,7 @@ yt-update-unseen-notification-count yt-viewport-scanned yt-visibility-refresh if (chatTypeChanged) { - if (attr_chatblock == 'chat$live') { + if (attr_chatblock == 'chat$live' && notWaitingRoom()) { _console.log(932, 4) diff --git a/manifest.json b/manifest.json index 9358eb7..e9e1977 100644 --- a/manifest.json +++ b/manifest.json @@ -16,7 +16,7 @@ "host_permissions": [ "https://www.youtube.com/*" ], - "version": "4.73.13", + "version": "4.73.14", "web_accessible_resources": [{ "resources": ["images/*.png", "js/injection*.js", "js/content.js", "css/style_*.css"], "matches": ["https://www.youtube.com/*"] diff --git a/version.ini b/version.ini index f60b9b4..90a9c4f 100644 --- a/version.ini +++ b/version.ini @@ -1 +1 @@ -4.73.13 \ No newline at end of file +4.73.14 \ No newline at end of file