Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fallback to manifest file if support for serviceworkers is not supported

I am making an app which will support the "Add to Homescreen" features in Android Chrome and iOS Safari. Since I would like universal offline support for both of these features, but I only want to use the manifest file where I have to, in order increase my control. However, iOS Safari does not support service workers, so my question is how can I only instantiate a cache manifest file if support for Service Workers is not present, more specifically; I know I could add manifest='whatever.appcache' to the <html> tag with JavaScript, but will browsers, specifically iOS Safari, use that cache?

like image 337
bren Avatar asked Jan 24 '26 05:01

bren


1 Answers

According to an answer by @Daniel Herr:

You could choose to use Service Workers and AppCache on the same web app. What happens in such a case is that browsers that don’t support Service Workers will use AppCache, and those that do will ignore the AppCache and let the Service Worker take over.

Sources: https://www.w3.org/TR/service-workers/#activation-algorithm, https://crbug.com/410665

Thanks for your answer!

like image 148
bren Avatar answered Jan 27 '26 00:01

bren



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!