Fix pause button: resend visibility on page load
The pause button wasn't appearing because preload.js variables were being reset when pages reloaded/navigated, but the visibility message was only sent once in attachView(). Now sends pause-button-visibility on EVERY page load (did-finish-load event) to ensure the button state persists across page reloads and navigation.
This commit is contained in:
@@ -4202,6 +4202,12 @@ function createWindow(){
|
||||
},true);
|
||||
});
|
||||
`).catch(()=>{});
|
||||
|
||||
// Send pause button visibility on every page load to handle reloads
|
||||
const siteDuration=parseInt(t.duration)||0;
|
||||
const shouldShow=siteDuration>0;
|
||||
view.webContents.send('pause-button-visibility',shouldShow);
|
||||
console.log('[MAIN] Page loaded - resending pause-button-visibility: '+shouldShow+' for '+t.url);
|
||||
});
|
||||
|
||||
const isHidden=parseInt(t.duration)===-1;
|
||||
|
||||
Reference in New Issue
Block a user