From ea59443748d2278babed9271ba9a6134b28f76f4 Mon Sep 17 00:00:00 2001 From: Frederic Jung Date: Wed, 4 Nov 2026 13:32:16 +0000 Subject: [PATCH] NOC window: wait as long as a window may go quiet before saying the pop-up was blocked A slow machine loading the whole page on a big network can take more than 4 s to say hello; the warning now waits NOC_LOST (10 s). --- src/game/94-dashboard/90-noc-window.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/game/94-dashboard/90-noc-window.js b/src/game/94-dashboard/90-noc-window.js index 35b3f3c..82b45fc 100644 --- a/src/game/94-dashboard/90-noc-window.js +++ b/src/game/94-dashboard/90-noc-window.js @@ -70,8 +70,9 @@ function nocWinBoot(){i18nDom();document.body.classList.add('noc-window');UI.dta NOC.yoAt=performance.now();nocBar();nocPost({t:'hello',id:NOC.id});if(!window.__TUBES_TEST__)setInterval(nocBeat,NOC_HB);} addEventListener('pagehide',()=>{if(!NOC.win&&NOC.peer&&UI.slot)nocPost({t:'bye',id:UI.slot});}); Object.assign(ACT,{ - // A second click finds the window that is already there. A blocked pop-up can only be told by its silence (noopener gives no handle). + // A second click finds the window that is already there. A blocked pop-up can only be told by its silence (noopener gives no + // handle): wait as long as a window may go quiet, since a slow machine loading the whole page can take seconds to say hello. nocWindow:()=>{if(!S||pzOn()||!UI.slot)return;const id=UI.slot;if(NOC.peer){nocPost({t:'focus',id});return;} window.open(location.pathname+'?noc='+id,'_blank','noopener,popup,width=1320,height=860'); - if(!window.__TUBES_TEST__)setTimeout(()=>{if(!NOC.peer&&UI.slot===id)toast(tr('noc.your_browser_blocked_the_window'),'bad');},4000);}, + if(!window.__TUBES_TEST__)setTimeout(()=>{if(!NOC.peer&&UI.slot===id)toast(tr('noc.your_browser_blocked_the_window'),'bad');},NOC_LOST);}, });