progressive-web-apps

Can I have multiple service workers both intercept the same fetch request?

半腔热情 提交于 2019-12-02 18:07:34
I'm writing a library which I will provide for 3rd parties to run a service worker on their site. It needs to intercept all network requests but I want to allow them to build their own service worker if they like. Can I have both service workers intercept the same fetches and provide some kind of priority/ordering between them? Alternatively is there some other pattern I should be using? Thanks No, you can not. Only one service worker per scope is allowed to be registered so the latest kick the previous one out unless the scope is more specific, in this case, the request is attended by the

What is progressive web app solution for IOS [closed]

℡╲_俬逩灬. 提交于 2019-12-02 16:08:51
I was wondering what's the solution of progressive web app for IOS devices since their default brower SAFARI doesn't yet support progressive web apps. Whats the alternate then for IOS counterparts? Please mind that "Browsers that support Progressive Web Apps" is not a real term, PWA itself is a set of features that a web app can provide for users. So it's not just only about Service Worker and App Manifest. Check out: Baseline PWA Checklist . Here are what you can do to achieve PWA on iOS/Safari at the moment this answer is created: Site is served over HTTPS ✅ Pages are responsive on tablets &

How to bring chrome to foreground from a web app

守給你的承諾、 提交于 2019-12-02 13:08:23
Is there any windows apps/google chrome flags/google chrome extension/javascript methods or any other thing that would allow to bring a chrome window from background(minimized) to foreground when something happens inside a website. I do have access to the client computer, I could set chrome flags/kiosk mode or anything that would prevent it from opening to foreground if it's possible. For example I am trying to bring the window to foreground when an order comes in, through a notification (I'm using firebase messages). I tried to do window.open() in setBackgroundMessageHandler() in the service

How do I deploy Angular App to Heroku and keep as PWA? [duplicate]

拜拜、爱过 提交于 2019-12-01 23:51:13
This question already has an answer here: Angular 6 PWA with Node not working 1 answer Summarize the problem : I'm trying to deploy my Angular 6 App to Heroku and keep the progressive web app features. There's no service worker for the end build on Heroku. Background : I've built a local Sports Store app in Angular 6. I'm following the book Pro Angular 6, 3rd Edition. by Adam Freeman and have gotten the app to roughly the stage at the end of chapter 9. GitHub repository of chapter 9: SportsStore To create this as a PWA I've run ng add @angular/pwa I edited the generated ngsw-config.json so it

Request location coordinates after user has blocked access in javascript

大憨熊 提交于 2019-12-01 23:34:19
问题 How can I prompt a user for their geo-location in javascript if they've blocked my request in the past? (using navigator.geolocation.getCurrentPosition). For example, my web app requires location services, and the user accidentally clicks "block", or they change their mind. What can I do to prompt them again? 回答1: As mentioned by @matthew-shwery, you can not change the permission. the best you could do is check for the permission and notify the user is the permission is denied navigator

Service worker - network first then cache with fallback to static page

泪湿孤枕 提交于 2019-12-01 21:11:30
I want to add service worker to my site to offer a good offline experience to my site users. (Site back-end is PHP) I'm still new to Javascript promises and service workers, but here is what i reached so far : my index.php page has this script to register service worker <script> if ('serviceWorker' in navigator) { navigator.serviceWorker.register('sw.js')}; </script> and for service worker file i use the following code var CACHE_STATIC_NAME = 'static-v74'; var CACHE_DYNAMIC_NAME = 'dynamic-v74'; self.addEventListener('install', function (event) { console.log('Installing Service Worker ...',

Service worker - network first then cache with fallback to static page

故事扮演 提交于 2019-12-01 20:38:19
问题 I want to add service worker to my site to offer a good offline experience to my site users. (Site back-end is PHP) I'm still new to Javascript promises and service workers, but here is what i reached so far : my index.php page has this script to register service worker <script> if ('serviceWorker' in navigator) { navigator.serviceWorker.register('sw.js')}; </script> and for service worker file i use the following code var CACHE_STATIC_NAME = 'static-v74'; var CACHE_DYNAMIC_NAME = 'dynamic

Storing big file pdf,xlsx into indexedDB and downloading from there

风格不统一 提交于 2019-12-01 14:58:02
I was trying to save a file into indexed db and download the same from indexed db once the system is offline. Am facing with two issue. The file which i pushed to db after downloading am not able to open the file. When large file such like anything more than 150 MB its breadking giving error in JSON.stringify() Putting my code below. Please help me am in desperate to finish this. is there anything am doing wrong any other better approach or even any leads to get it correct will be relay helpful downloadfile() { var self = this; var getComment = 'http://localhost/PWAS/CommentService/api

PWA Openning in Bowser mode while being in Standalone mode

泄露秘密 提交于 2019-12-01 11:24:31
We built a Progressive Web App from an existing angular 4 project. everything worked well till we added the manifest file. When you access the App from the browser it prompt you to add it to the home screen. But after add it, when you clicked on the Icon from the home screen it open in the Browser mode intead of the Standalone mode . I don't know why it is behaving so and what can be the problem. Bellow is my manifest.json file please help me. { "name": "Mobile Application", "short_name": "Mobile App", "icons": [ { "src": "assets/icons/android-icon-36x36.png", "sizes": "36x36", "type": "image

PWA Openning in Bowser mode while being in Standalone mode

三世轮回 提交于 2019-12-01 09:43:47
问题 We built a Progressive Web App from an existing angular 4 project. everything worked well till we added the manifest file. When you access the App from the browser it prompt you to add it to the home screen. But after add it, when you clicked on the Icon from the home screen it open in the Browser mode intead of the Standalone mode . I don't know why it is behaving so and what can be the problem. Bellow is my manifest.json file please help me. { "name": "Mobile Application", "short_name":