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).
This commit is contained in:
parent
97e7cb17bd
commit
ea59443748
1 changed files with 3 additions and 2 deletions
|
|
@ -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);},
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue