Add /display manifest for Android home-screen install
Android Chrome only reads manifest at install time from current page. Root manifest has start_url '.' (root). Installing from /display launched root. Fix: separate display-manifest.json (start_url /display, scope /, landscape). App.js swaps link[rel=manifest] href when on /display path. Install from /display now launches /display standalone.
This commit is contained in:
+5
-1
@@ -3519,8 +3519,12 @@ function App() {
|
||||
|
||||
useEffect(() => {
|
||||
const queryParams = new URLSearchParams(window.location.search);
|
||||
if (queryParams.get('playerView') === 'true' || window.location.pathname === '/display') {
|
||||
const isDisplay = queryParams.get('playerView') === 'true' || window.location.pathname === '/display';
|
||||
if (isDisplay) {
|
||||
setIsPlayerViewOnlyMode(true);
|
||||
// swap manifest so Android home-screen installs launch /display
|
||||
const link = document.querySelector('link[rel="manifest"]');
|
||||
if (link) link.href = `${process.env.PUBLIC_URL || ''}/display-manifest.json`;
|
||||
}
|
||||
if (window.location.pathname === '/logs') {
|
||||
setIsLogsMode(true);
|
||||
|
||||
Reference in New Issue
Block a user