progressive-web-apps

is it possible to modify service worker cache response headers?

久未见 提交于 2020-01-22 14:03:17
问题 I am trying to mark resources that are being stored in the service worker cache. I thought it would be possible to add a custom header to the resource that could indicate this, however, it appears that header modifications are removed once a resource is stored in the service worker cache. Is this the case? I don't see anything in the cache spec about modifying response headers. Here is an example of what I have tried: // I successfully cache a resource (confirmed in Dev Tools) caches.open(

Angular PWA in IIS subfolder not work offline

谁说胖子不能爱 提交于 2020-01-22 03:29:13
问题 When I publish angular pwa application to subfolder in IIS, pwa application not work in offline. ng build --prod --baseHref=/subfolder/ does not help. I use https on web site. How exactly reconfigure angular pwa application to work offline if application is not published to root of IIS but to subfolder of IIS? Does anybody have functional demo of angular pwa application working offline after publishing to IIS subfolder? 回答1: I know I am very late on this, I have also struggled on this and

How to close a progressive web app

早过忘川 提交于 2020-01-21 04:42:21
问题 Once a pwa is installed a mobile device, how do I close the application like a native app without having the user click the back button multiple times. I understand it's a bad idea to window.close on a web page but this a pwa on a mobile device. In Cordova you will use navigator.app.exitApp , this is of course not available on pwa. 回答1: This is a solution I created today. When you click the back button a dialog will request you to just click the back button one more time to actually close the

Is there a way to flag that a progressive web app requires a hardware keyboard?

走远了吗. 提交于 2020-01-15 12:47:11
问题 I know that the whole concept of PWA is for a app to scale across all screen sizes I have written an IDE-like application (in a PWA), that is information dense, and I want my PWA to be portable across desktop OSs (mouse + keyboard), and tablets (touch + hardware keyboard). My app is not really meant for mobile OSs. There are many keyboard short cuts, and whilst I could add UI elements to simulate these key presses, the screen is already action packed enough. The app simply doesn't belong on

How to update Reactjs based PWA to the new version?

强颜欢笑 提交于 2020-01-15 08:00:28
问题 I'm developing a reactjs based application. I also made service-worker settings on it. After add to home screen , application never checks the server for new updates. I also tried: window.location.reload(true); But it doesn't update new version. I'm using Apache server to serve build folder and for update I'm getting a new build of my project and serve that on Apache server. 回答1: I finally resolved my problem after two days. The problem was in service-worker file. I had to add event listener

Is there a way to use the mailto: or message: scheme in a PWA in iOS 12.2?

China☆狼群 提交于 2020-01-14 13:51:15
问题 I've built a PWA using Ionic 4 that had a "Contact" Button with a simple href using the 'mailto:' scheme. <a href="mailto:example@gmail.com">Contact</a> This used to open the native Mail app in iOS 12.1 when starting the PWA from homescreen. Since I updated to iOS 12.2 it just opens the PWA internal Safari with a message that Safari can't open links starting with 'mailto:' I have tried using other URI schemes like 'instagram:' or 'message:' but they all lead to the same problem. The only one

The semantics of @Injectable(providedIn: 'root')?

我怕爱的太早我们不能终老 提交于 2020-01-14 12:17:06
问题 Just want to make sure I understand the semantics of @Injectable(providedIn: 'root') . Prior to Angular 6 if we import a module from NPM that contains a service we would declare that module in our app module such that the entire application has access to the service. Something like this: import { SomeNPModule } from '@ngx/SomeNPModule'; @NgModule({ imports: [ BrowserModule, SomeNPModule ] }) export class AppModule {} Now we can inject the SomeService that the module provides because we have

TypeError: Failed to register a ServiceWorker: A bad HTTP response code (404) was received when fetching the script

早过忘川 提交于 2020-01-14 05:04:28
问题 I'm trying to add a service worker to a website.I'm using Node.js with Express.js,Vue.js and EJS.^ My node server (index.js) looks like : const https = require('https'); const fs = require('fs'); const express = require('express'); const app = express(); const router = express.Router(); const pool = require('./mysqldb.js'); const pathView = __dirname + "/views/"; var bodyParser = require("body-parser"); const listenPort = 8010; // Process application/x-www-form-urlencoded app.use(bodyParser

Web App Manifest not parsed by Chrome Dev Tools

怎甘沉沦 提交于 2020-01-13 20:33:09
问题 I have a manifest.json according to the MDN spec and while it works correctly when browsing the website from a mobile device (add to homescreen popup shows up, theme color and icons load...etc) Chrome Dev Tools is unable to parse it. The same problem persists on Lighthouse (chrome extension). Has anyone seen a similar issue? I would think that the JSON is invalid however copy-pasting into Web App Validator it is marked correct, but when inputting the URL it giving a parse error: File isn't

React/WordPress PWA does not respond with a 200 when offline

别说谁变了你拦得住时间么 提交于 2020-01-13 16:59:46
问题 I am currently trying to build a WordPress theme using React/Redux. Everything is working as expected except for responding with 200 when offline. The build folder of CRA (Create React App) is located at /wp-content/themes/pwa/build . When online, WordPress loads the index.php for all routes. This registers the .css and .js from the build folder. Here everything is working as expected. Im trying to understand how to configure CRA / WorkBox to register the service worker at / and serve all