Skip to content

Commit

Permalink
v4.73.14
Browse files Browse the repository at this point in the history
added `notWaitingRoom` checking
  • Loading branch information
cyfung1031 committed Jul 5, 2024
1 parent 3a42cbb commit 1b99604
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 3 deletions.
51 changes: 50 additions & 1 deletion js/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/*"]
Expand Down
2 changes: 1 addition & 1 deletion version.ini
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.73.13
4.73.14

0 comments on commit 1b99604

Please sign in to comment.