mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-06 23:57:19 +02:00
Fix the fullscreen bug on Android (#49)
This commit is contained in:
parent
da7ff64471
commit
5a5c65e7a2
@ -2784,6 +2784,22 @@ function onStreamStarted($video) {
|
||||
}
|
||||
|
||||
|
||||
function disablePwa() {
|
||||
const userAgent = (window.navigator.orgUserAgent || window.navigator.userAgent || '').toLowerCase();
|
||||
if (!userAgent) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if it's Safari on mobile
|
||||
if (userAgent.includes('mobile') && userAgent.includes('safari') && !userAgent.includes('chrom')) {
|
||||
// Disable the PWA prompt
|
||||
Object.defineProperty(window.navigator, 'standalone', {
|
||||
value: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Hide Settings UI when navigate to another page
|
||||
window.addEventListener('xcloud_popstate', onHistoryChanged);
|
||||
window.addEventListener('popstate', onHistoryChanged);
|
||||
@ -2831,7 +2847,4 @@ setupVideoSettingsBar();
|
||||
setupScreenshotButton();
|
||||
StreamStats.render();
|
||||
|
||||
// Disable PWA prompt in Safari on iOS/iPadOS
|
||||
Object.defineProperty(window.navigator, 'standalone', {
|
||||
value: true,
|
||||
});
|
||||
disablePwa();
|
||||
|
Loading…
x
Reference in New Issue
Block a user