All Projects → GoogleChromeLabs → Pwacompat

GoogleChromeLabs / Pwacompat

Licence: apache-2.0
PWACompat to bring Web App Manifest to older browsers

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Pwacompat

Vue Pwa Asset Generator
PWA asset generator perfect with VueJS framework (but useful for all PWA!)
Stars: ✭ 97 (-90.39%)
Mutual labels:  manifest, pwa
Pwafire
Progressive Web Apps API of APIs
Stars: ✭ 137 (-86.42%)
Mutual labels:  manifest, pwa
Pwa Asset Generator
Automates PWA asset generation and image declaration. Automatically generates icon and splash screen images, favicons and mstile images. Updates manifest.json and index.html files with the generated images according to Web App Manifest specs and Apple Human Interface guidelines.
Stars: ✭ 1,787 (+77.11%)
Mutual labels:  manifest, pwa
Service Worker Detector
This extension detects if a website registers a Service Worker.
Stars: ✭ 124 (-87.71%)
Mutual labels:  manifest, pwa
angular-pwa-starter
Lightweight starter 'ng init' with added app shell features (sw-precache, web app manifest).
Stars: ✭ 22 (-97.82%)
Mutual labels:  manifest, pwa
Yinyue
🏖Version Of Progressive Web App ( Serverless )
Stars: ✭ 57 (-94.35%)
Mutual labels:  manifest, pwa
Webapp Webpack Plugin
[DEPRECATED] use favicons-webpack-plugin instead
Stars: ✭ 127 (-87.41%)
Mutual labels:  manifest, pwa
Pwa Module
Zero config PWA solution for Nuxt.js
Stars: ✭ 1,033 (+2.38%)
Mutual labels:  manifest, pwa
Jfa Pwa Toolkit
⚡️ PWA Features to Any Website (very Fast & Easy)
Stars: ✭ 245 (-75.72%)
Mutual labels:  manifest, pwa
Learning Pwa
📱some samples and blogs about how to start with your first PWA
Stars: ✭ 162 (-83.94%)
Mutual labels:  manifest, pwa
Ember Web App
NOTICE: official repository moved to https://github.com/zonkyio/ember-web-app
Stars: ✭ 143 (-85.83%)
Mutual labels:  manifest, pwa
Webpack Pwa Manifest
Progressive Web App Manifest Generator for Webpack, with auto icon resizing and fingerprinting support.
Stars: ✭ 447 (-55.7%)
Mutual labels:  manifest, pwa
Pwa Bugs
🚔 List of PWA Bugs and workarounds
Stars: ✭ 444 (-56%)
Mutual labels:  manifest, pwa
Awesome Meta And Manifest
⚡ Awesome collection of meta tags & manifest properties.
Stars: ✭ 499 (-50.55%)
Mutual labels:  manifest, pwa
Pwa Example
A short example illustrating some essential steps for creating a progressive web app (PWA).
Stars: ✭ 28 (-97.22%)
Mutual labels:  pwa
Ionic Navigation And Routing
🎉 Ionic 5 tutorial to learn how to master Routing and Navigation in Ionic Angular Apps as well as some usability tricks you can add to your Ionic Framework apps to make them look even better!
Stars: ✭ 35 (-96.53%)
Mutual labels:  pwa
Hoppscotch
👽 Open source API development ecosystem https://hoppscotch.io
Stars: ✭ 34,569 (+3326.07%)
Mutual labels:  pwa
Next Pwa
Zero config PWA plugin for Next.js, with workbox 🧰
Stars: ✭ 909 (-9.91%)
Mutual labels:  pwa
Codenameone
Cross-platform framework for building truly native mobile apps with Java or Kotlin. Write Once Run Anywhere support for iOS, Android, Desktop & Web.
Stars: ✭ 992 (-1.68%)
Mutual labels:  pwa
Docker Vue Node Nginx Mongodb Redis
🐉 An awesome boilerplate, Integrated Docker, Vue, Node, Nginx, Mongodb and Redis in one, Designed to develop & build your web applications more efficient and elegant.
Stars: ✭ 34 (-96.63%)
Mutual labels:  pwa

Build Status

PWACompat is a library that brings the Web App Manifest to non-compliant browsers for better Progressive Web Apps. This mostly means creating splash screens and icons for Mobile Safari, as well as supporting IE/Edge's Pinned Sites feature.

So, if you've created a manifest.webmanifest but want to have wide support everywhere else—through legacy HTML tags for icons and theming—look no further. We recommend including it from a CDN to get the latest version, or bundling it yourself:

<link rel="manifest" href="manifest.webmanifest" />
<script async src="https://cdn.jsdelivr.net/npm/pwacompat" crossorigin="anonymous"></script>
<!-- or another CDN -->
<script async src="https://unpkg.com/pwacompat" crossorigin="anonymous"></script>

And you're done^! 🎉📄

For more on the Web App Manifest, read 📖 how to add a Web App Manifest and mobile-proof your site, watch 📹 theming as part of The Standard, or check out 📬 the Web Fundamentals post on PWACompat.

PWACompat explainer
PWACompat takes your regular manifest and enhances other browsers

^Best Practice & Caveats

While PWACompat can generate most icons, meta tags etc that your PWA might need, it's best practice to include at least one <link rel="icon" ... />. This is standardized and older browsers, along with search engines, may use it from your page to display an icon. For example:

<link rel="manifest" href="manifest.webmanifest" />
<script async src="path/to/pwacompat.min.js"></script>
<!-- include icon also from manifest -->
<link rel="icon" type="image/png" href="res/icon-128.png" sizes="128x128" />

You should also consider only loading PWACompat after your site is loaded, as adding your site to a homescreen is a pretty rare operation. This is the approach taken on v8.dev and Emojityper.

iOS

PWACompat looks for a viewport tag which includes viewport-fit=cover, such as <meta name="viewport" content="viewport-fit=cover">. If this tag is detected, PWACompat will generate a meta tag that makes your PWA load in fullscreen mode—this is particularly useful for devices with a notch.

You can customize the generated splash screen's font by using a CSS Variable. For example:

<style>
  link[rel="manifest"] {
     --pwacompat-splash-font: 24px Verdana;
  }
</style>

This is set directly as a canvas font, so you must as a minimum include size and family. The default value is "24px HelveticaNeue-CondensedBold".

⚠️ PWACompat won't wait for your fonts to load, so if you're using custom fonts, be sure to only load the library after they're ready.

Old Versions

Prior to iOS 12.2, Mobile Safari opens external sites in the regular browser, meaning that flows like Oauth won't complete correctly. This isn't a problem with PWACompat, but is an issue with PWAs on iOS generally.

Session Storage

PWACompat uses window.sessionStorage to cache your site's manifest (and on iOS, any updated icons and generated splash screens). This expires after a user navigates away from your page or closes their tab.

Details

What does PWACompat actually do? If you provide a Web App Manifest, PWACompat will update your page and:

  • Create meta icon tags for all icons in the manifest (e.g., for a favicon, older browsers)
  • Create fallback meta tags for various browsers (e.g., iOS, WebKit/Chromium forks etc) describing how a PWA should open
  • Sets the theme color based on the manifest

For Safari, PWACompat also:

  • Sets apple-mobile-web-app-capable (opening without a browser chrome) for display modes standalone, fullscreen or minimal-ui
  • Creates apple-touch-icon images, adding the manifest background to transparent icons: otherwise, iOS renders transparency as black
  • Creates dynamic splash images, closely matching the splash images generated for Chromium-based browsers

For IE and Edge:

For PWAs on Windows with access to UWP APIs:

  • Sets the titlebar color

Do you think PWACompat should support backfilling more HTML tags needed for older browsers? Let us know!

Demo

For a demo, try adding Emojityper or the demo site to an iOS home screen (to see splash screens and icons). You can also install Emojityper from the Microsoft Store (where the titlebar color is automatically set the manifest's theme_color).

Support

This is supported in most modern browsers (UC Browser, Safari, Firefox, Chrome, IE10+), and fails silenty when unsupported. Mobile Safari benefits the most from PWACompat, as generating a large number of splash screens manually is a complex task.

Web App Manifest

Your Web App Manifest is:

  • normally named manifest.webmanifest (although some folks name it manifest.json)
  • referenced from all pages on your site like <link rel="manifest" href="path/to/manifest.webmanifest" />
  • and should look a bit like this:
{
  "name": "Always Be Progressive",
  "short_name": "Progressive!",
  "display": "browser",
  "start_url": "/",
  "background_color": "#102a48",
  "icons": [
    {
      "src": "res/icon-256.png",
      "sizes": "256x256"
    },
    {
      "src": "res/icon-128.png",
      "sizes": "128x128"
    }
  ]
}

For more information on the Web App Manifest, and how e.g., modern browsers will prompt engaged users to install your site to their home screen, check out Web Fundamentals. There's also a number of online generators.

Release

Compile code with Closure Compiler.

// ==ClosureCompiler==
// @compilation_level ADVANCED_OPTIMIZATIONS
// @output_file_name pwacompat.min.js
// ==/ClosureCompiler==

// code here
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].