progressive-web-apps

Detect webrequest coming from PWA on the server side

大憨熊 提交于 2021-02-19 07:07:26
问题 I'm adding PWA support to a web app. I want to add a back-button to the interface for iOS when the app is used as a PWA but not when used in the old fashioned way in Safari (or another browser). I know I can detect this via JS - so I could just show/hide the back-button at runtime, but I would like to know if there is any way to detect in on the server-side already ( apache/php ). I guess there will be more use-cases coming up to serve slightly different content. I guess I could set a cookie

PWA doesn't load when router is in history mode (Vue CLI 3 based project)

不羁岁月 提交于 2021-02-18 12:56:09
问题 I have a Vue CLI 3 based app which I would like to function as a PWA. I need it to work in history mode, because the hash intervenes in redirects that I'm doing as part of an OAuth based authentication process. When the routing is in hash mode, the manages to load fine as PWA. Once I change the mode to 'history', the PWA I installed won't load anymore - I'm getting a white screen instead. I checked the browser version and it still works fine (I configured the fallback in my NGINX server to

PWA doesn't load when router is in history mode (Vue CLI 3 based project)

杀马特。学长 韩版系。学妹 提交于 2021-02-18 12:56:06
问题 I have a Vue CLI 3 based app which I would like to function as a PWA. I need it to work in history mode, because the hash intervenes in redirects that I'm doing as part of an OAuth based authentication process. When the routing is in hash mode, the manages to load fine as PWA. Once I change the mode to 'history', the PWA I installed won't load anymore - I'm getting a white screen instead. I checked the browser version and it still works fine (I configured the fallback in my NGINX server to

How to programmatically switch display from standalone to fullscreen in PWA

我的未来我决定 提交于 2021-02-11 13:10:31
问题 My PWA works as expected when I set the "display" of my manifest to "fullscreen" or "standalone". But, I want my users to be able to toggle back and forth in settings. Is there a way to switch this programmatically in JavaScript? 回答1: try this if you want to be sure that it will work in all browsers. function getFullScreen() { if (document.body.requestFullscreen) { document.body.requestFullscreen(); } else if (document.body.mozRequestFullScreen) { /* Firefox */ document.body

How to programmatically switch display from standalone to fullscreen in PWA

*爱你&永不变心* 提交于 2021-02-11 13:05:43
问题 My PWA works as expected when I set the "display" of my manifest to "fullscreen" or "standalone". But, I want my users to be able to toggle back and forth in settings. Is there a way to switch this programmatically in JavaScript? 回答1: try this if you want to be sure that it will work in all browsers. function getFullScreen() { if (document.body.requestFullscreen) { document.body.requestFullscreen(); } else if (document.body.mozRequestFullScreen) { /* Firefox */ document.body

How to programmatically switch display from standalone to fullscreen in PWA

左心房为你撑大大i 提交于 2021-02-11 13:05:13
问题 My PWA works as expected when I set the "display" of my manifest to "fullscreen" or "standalone". But, I want my users to be able to toggle back and forth in settings. Is there a way to switch this programmatically in JavaScript? 回答1: try this if you want to be sure that it will work in all browsers. function getFullScreen() { if (document.body.requestFullscreen) { document.body.requestFullscreen(); } else if (document.body.mozRequestFullScreen) { /* Firefox */ document.body

beforeinstallprompt does not work on console.log

安稳与你 提交于 2021-02-11 12:52:48
问题 on https://www.zamanha.com/sw.js on self.addEventListener('beforeinstallprompt', (e) => { the console.log() does not work. anyone? 回答1: the answer is in below. but it is very important to put it in the main.js that runs service worker like sw.js. after regissteration of service worker if ('serviceWorker' in navigator) { navigator.serviceWorker.register('/sw.js') } else { console.log('CLIENT: service worker is not supported.'); } this code -----> var deferredPrompt; self.addEventListener(

The theme-color meta tag did not contain a valid CSS color

岁酱吖の 提交于 2021-02-11 12:29:31
问题 I have a PWA app and when I do an Audit using the Chrome development tools, I get this message saying the CSS color code is invalid: Failures: The theme-color meta tag did not contain a valid CSS color. I beg to differ. It's a valid CSS color code. Also the Google dev page says: Lighthouse does not test whether the values are valid CSS color values. but that's contrary to what the audit complains about. I searched for this message and there's very little, or should I say, next to nothing,

Possibilities to scan qr-code in flutter web

丶灬走出姿态 提交于 2021-02-11 06:16:12
问题 I want to build a PWA based on flutter web which relies on scanning a QR-Code and accessing the user's current position. From my point of knowledge for both functionalities there are currently no packages available. However for getting the user's location there is a stackoverflow thread (Get User's Location for flutter Web) providing a solution. So I'm wondering if there is any chance that there is a similar solution for the QR-Scanning issue? Sadly, I'm not very familiar with web and

Set start_url in web app manifest based on the URL that was added to homescreen

妖精的绣舞 提交于 2021-02-08 14:56:33
问题 My site has several subsections. When a user adds the site to their homescreen, I'd like to make sure that the home screen icon launches them into the subsection they were on when they added to homescreen. I can register a different manifest for each subsection, but this doesn't work for single page apps where there's no page reload. I'm considering storing the subsection in a cookie and then redirecting from a generic start URL based on that cookie. Is there a better way to do this? 回答1: If