- From: hrantabelyan <notifications@github.com>
- Date: Mon, 22 Feb 2021 16:44:36 -0800
- To: w3c/manifest <manifest@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/manifest/issues/954/783784427@github.com>
Quote - "Client hints are extra headers that the user agent sets on requests. They are only set when the server explicitly requests them in it's response headers. So there needs to be at least one request to the origin before these are sent to the server." There is still one request should be sent first, what if user opens a link from email with installed PWA (standalone mode) app? in this case even start_url will not be triggered, only if there could be a way to do it without first request. BUT, this actually can work like this - server can detect if request header doesn't have display-mode in it and pass a corresponding variable to JS - browser will check if (1) it supports adding display-mode Client Hint and (2) "display-mode" = "standalone", if true, it will call window.location.reload() - on reload, the browser will send the display-mode to server - on all next http requests from same origin, the browser will send display-mode header Think this can work I think. One question, browser will detect the display-mode automatically to send to the server, right? Conclusion, anyway I think for now this feature support is too poor, meantime will use a workaround, almost same thing that above, but Cookies will be used instead of CH, here is how: Browser checks if "display-mode" = "standalone" and if there is a "pwa_standalone" cookie, if is standalone but there is no cookie, it adds the cookie and refreshes the page, so server knows the display-mode, and if user opens the browser after that let's say, then browser sees that there is a cookie but display-mode isn't standalone, think this can work -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3c/manifest/issues/954#issuecomment-783784427
Received on Tuesday, 23 February 2021 00:44:49 UTC