progressive-web-apps

WebAPK ignores display:standalone flag for PWA running on local network

拟墨画扇 提交于 2019-12-10 00:14:30
问题 I am developing a PWA for which I want to have "add to home screen" (a2hs) functionality in standalone display mode. During development, my PWA is running on a server which is accessible from within my local network only (not from outer internet). When testing a2hs on Chrome for Android, I encounter the following strange behavior. Simple add to home screen When my PWA is added to the home screen as a normal shortcut, then everything works fine. Clicking on the shortcut will open the PWA in

Saving a custom Response using the Cache Storage API

半世苍凉 提交于 2019-12-09 23:57:49
问题 I'm using Cache Storage to build an progressive web app ( PWA ). There is a custom object that I need to put into my cache, but the cache accepts Response objects as an argument. So my question is how to properly create Response object, that has the JSON in it. I know I can use other caching strategies ( localStorage or IndexedDB ) but I'm particularly curious about this case - saving custom JSON in cache as a request. var myJSON = JSON.stringify({custom:"object"}); caches.open('cache-name')

Open external links in webview as default in IOS PWA

为君一笑 提交于 2019-12-09 17:59:07
问题 I'm testing Progressive Web App in IOS 11.3. My pwa has a Facebook social login button that, when clicked, points to an external link (different windows.location). The problem is that the pwa opens safari app to show external links instead of using a webview within the pwa. So, when the login is done, you will not be redirected to the pwa, but remains in safari. I tried following examples like this one: https://gist.github.com/kylebarrow/1042026 but seems not working How can I force the pwa

Requirements to make PWA in a WebAPK format

戏子无情 提交于 2019-12-09 15:50:04
问题 I am working on my website. I managed to get basic PWA functionality using the web page manifest file. Not long ago, Google released deeply integrated PWAs, allowing users to make a WebAPK when they added the page into the home screen. I want my page to also have that kind of feature, but it is never been clear what I should do to get that functionality.. Do I need to add something extra aside from the manifest file, sw.js and various meta tags? 回答1: This is not something we can control.

Add more service-worker functionality with create-react-app

半腔热情 提交于 2019-12-09 14:42:30
问题 So create-react-app includes service worker functionality by default, which is lovely - all my static assets get cached for offline use out of the box. Cool, but now I want to take things a bit further and use indexedDB to cache some dynamic content. Problem is, there's no service-worker.js file to modify. It gets generated during the build process. Is there a way to add additional logic without ejecting create-react-app or redoing all the nice static caching stuff? 回答1: As you've observed,

An unknown error occurred when fetching the script (Service Worker)

淺唱寂寞╮ 提交于 2019-12-09 14:30:42
问题 When going offline, I get the following error by my service worker: (unknown) #3016 An unknown error occurred when fetching the script my service worker looks like this: var version = 'v1' this.addEventListener('install', function(event){ event.waitUntil( caches.open(version).then(cache => { return cache.addAll([ 'https://fonts.googleapis.com/icon?family=Material+Icons', 'https://fonts.googleapis.com/css?family=Open+Sans:400,600,300', './index.html' ]) }) ) }) this.addEventListener('fetch',

Progressive web application - not honouring screen orientation

♀尐吖头ヾ 提交于 2019-12-09 08:02:28
My web app is not honouring the orientation set in my manifest.json : { "manifest_version": 2, "version": "1", "name": "My App", "short_name": "My App", "icons": [ { "src": "img/myapp/launcher-icon-0-75x.png", "sizes": "36x36", "type": "image/png" }, { "src": "img/myapp/launcher-icon-1x.png", "sizes": "48x48", "type": "image/png" }, { "src": "img/myapp/launcher-icon-1-5x.png", "sizes": "72x72", "type": "image/png" }, { "src": "img/myapp/launcher-icon-2x.png", "sizes": "96x96", "type": "image/png" }, { "src": "img/myapp/launcher-icon-3x.png", "sizes": "144x144", "type": "image/png" }, { "src":

Progressive Web App “does not work offline” error

走远了吗. 提交于 2019-12-09 06:54:15
问题 I have written a progressive web app, following all available guides and examples, but for some reason when I click the Add to homescreen button, I keep getting this mysterious error: Site cannot be installed: does not work offline The major difference between my PWA and the examples, is that mine is running purely in a non-root path of the domain, so I have had to add extra paths to the configs in various places so the app is restricted to the non-root folder. The Google Lighthouse site

Videoportal PWA (Progressive Web App) Video offline function?

末鹿安然 提交于 2019-12-08 17:36:35
问题 We want to build a Videoportal as a PWA. Every video will have a watch offline feature. Can this be done via the Serviceworker caching? Or should another Download-Mechanism enable this Feature. The videos size is about 120mb. Target Device is Android and Web.(Sorry for bad english) 来源: https://stackoverflow.com/questions/44303314/videoportal-pwa-progressive-web-app-video-offline-function

Long time waiting Request to Service Worker

南楼画角 提交于 2019-12-08 16:04:54
问题 I have noticed that the time waiting for service workers to respond with items from the cache is not as fast as you would expect it to be. I have seen the same wait times with both sw-precache and a custom written service worker. What are the possible causes for this wait time time and how could I reduce it? My fetch event on the custom service worker looks like: self.addEventListener('fetch', function(event) { event.respondWith( caches.match(event.request).then(function(response) { if