Re: [w3c/manifest] Allow setting an HTTP request for server side PWA detection (#954)

> There is really no way to detect standalone PWA on server side? It makes things very complicated, there is a logic for some ajax requests and content parts that are not needed for PWAs, of course we can use window.navigator.standalone or window.matchMedia() to detect standalone mode, then use CSR to fetch the appropriate content and for ajax requests just add that is_pwa parameter, but it's just too much not needed things for many startups that want to have their PWAs without doing tons of changes to their current code, if just there was a way to define a special HTTP request header in manifest.json to use on all requests.
> 
> For now thinking about a very quick and messy solution that can work, use JS to rewrite all internal links (hrefs) and add query parameter to them. So, first time when app is opened with the start_url that has a special query parameter, we will use it on server side to know that we have a PWA user, then on client side we will rewrite all links to include that parameter as well, but it's a very poor solution, it will be easier to replace links on front end, but what about back-end redirections and ajax responses that contain a link?
> 
> It's a really great technology and I enjoying to work with it, but lack of this feature is much frustrating :(
> 
> P.S. Tried to use cookies for detection, adding is_pwa cookie helped, but not much, because PWA installed app and browser are sharing the same cookies, but we really don't want our mobile view and standalone PWA app to function the same way

Hello, the problem solved? I need a solution for server side PWA detection. 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/manifest/issues/954#issuecomment-1176045392
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/manifest/issues/954/1176045392@github.com>

Received on Wednesday, 6 July 2022 10:17:08 UTC