pwacompat | PWACompat to bring Web App Manifest to older browsers | Web Framework library

 by   GoogleChromeLabs JavaScript Version: 2.0.17 License: Apache-2.0

kandi X-RAY | pwacompat Summary

kandi X-RAY | pwacompat Summary

pwacompat is a JavaScript library typically used in Server, Web Framework, Webpack applications. pwacompat has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

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.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              pwacompat has a medium active ecosystem.
              It has 1107 star(s) with 79 fork(s). There are 33 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 7 open issues and 35 have been closed. On average issues are closed in 54 days. There are 6 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of pwacompat is 2.0.17

            kandi-Quality Quality

              pwacompat has 0 bugs and 0 code smells.

            kandi-Security Security

              pwacompat has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              pwacompat code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              pwacompat is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              pwacompat releases are available to install and integrate.
              Installation instructions are not available. Examples and code snippets are available.
              pwacompat saves you 34 person hours of effort in developing the same functionality from scratch.
              It has 91 lines of code, 0 functions and 7 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed pwacompat and discovered the below as its top functions. This is intended to give you an instant insight into pwacompat implemented functionality, and help decide if they suit your requirements.
            • Process icon files
            • Draw a splash icon .
            • setup manifest
            • Fetch splash icon .
            • Update the current theme color
            • Redraw and redraw the img icons
            • Updates a transparent image with the given background .
            • Normalize icon data
            • set splash screen icon
            • Find the Apple Id for an Apple Id .
            Get all kandi verified functions for this library.

            pwacompat Key Features

            No Key Features are available at this moment for pwacompat.

            pwacompat Examples and Code Snippets

            No Code Snippets are available at this moment for pwacompat.

            Community Discussions

            QUESTION

            Proper "Scope" setup for manifest. Not working as expected
            Asked 2019-Sep-22 at 22:50

            For my pwa I am having issue where the manifest.json gets called on the end of whatever page I'm on like mydomain.com/subpage/manifest.json which I believe is incorrect and should be called only for home page like mydomain.com/manifest.json because that's where my manifest is located (src folder) and other pages should just be treated normally because I believe its causing problems where reloading a subpage causes error and redirects to home page

            From looking around it seams setting manifest like

            ...

            ANSWER

            Answered 2019-Sep-22 at 22:50

            scope does not have any effect on where manifest.json is loaded from. It can't since you get into a chicken and egg problem. manifest.json is loaded based on your HTML tab. Currently you have the following:

            Source https://stackoverflow.com/questions/58044983

            QUESTION

            Progressive Web App: Error Accessing navigator.mediaDevices.getUserMedia?
            Asked 2019-Sep-14 at 17:45

            My app accesses the camera for purposes of webrtc, and works correctly.

            I'm using pwacompat from Google Labs to add pwa features to my web app.

            When running the app as a pwa, everything works fine until I access the camera. Then I get this console.log error:

            getUserMedia failedObject {type: "error", msg: "undefined is not an object (evaluating 'navigat…"}

            getUserMedia failed type: error msg: undefined is not an object (evaluating 'navigator.mediaDevices.getUserMedia')

            What am I missing?

            ...

            ANSWER

            Answered 2019-Sep-14 at 17:45

            Update - 14/09/2019

            There are changes to Safari on iOS 13 & Safari 13: https://developer.apple.com/documentation/safari_release_notes/safari_13_release_notes

            SFSafariViewController has gained getUserMedia functionality (!!!, however I need to confirm this, please see below for reports of it working)

            However WKWebView does not seem to gain getUserMedia functionality:

            iOS 13 and Safari 13 release notes:

            Edit

            In short: A PWA or any website being used on iOS outside of the native Safari app will not be allowed access to getUserMedia as Apple is deliberately blocking access for "Security concerns". This includes any websites saved to the homescreen and/or viewed inside another application such as Facebook. The same restrictions apply to Android however on Android the app developer can ask for Camera permissions and get around this. (This means if you are a website developer and you need camera functionality, you will need to ask Facebook, etc, to rebuild their app to allow this on Android).

            See their bug tracker here: http://www.openradar.me/33571214 and https://forums.developer.apple.com/thread/88052

            From web based Safari experiences to Native Android, etc. I make crossplatform Apps in web and native for a living. There are several potential problems you will encounter with getUserMedia. To workout what is causing potential problems you should follow this list in order to create a successful application.

            Your problem is specifically 1. because you are not successfully querying the API. Nevertheless the MediaCapture from getUserMedia should fail because after fixing 1. you will encounter 2. and 3.

            1. API Polyfil - Always make sure you include the latest getUserMedia adapter to stop any cross-platform inconsistencies in the getUserMedia API. Some browsers might use the old getUserMedia API (via 'navigator.getUserMedia) and have not been updated (to use navigator.mediaDevices.getUserMedia). You should also check this link for other needed polyfills.
            2. Support - Check CanIUse for getUserMedia support for your target audience and make sure you have the necessary fallbacks. Your fallback for if (navigator && navigator.mediaDevices && navigator.mediaDevices.getUserMedia) { return true; } else return false; returns false, and if getUserMedia throws and error ideally should be the same.
            3. Permissions - Even though you include pwacompat it does not mean the browser window has the permissions to access the camera. This is because not all browsers are equal! iOS 11 allows getUserMedia access inside of the native Safari app only. However you cannot access getUserMedia on iOS 11 WKWebView or UIWebViews. When you save an app to the homepage it is hosted inside a WKWebView. Thus an experience which works inside of Safari will not work when saved to the homescreen or inside another application. Confusing eh?..! Thus if you want your experience to work you need to tell the user when they open upside another app that they must open the website in safari for real-time camera access. There is no way around this. On Android an app maker can override this permission and allow access to getUserMedia. If you use macOS or Windows you need to make sure the browser shell also has getUserMedia compatibility (e.g. Edge+, Chrome, Firefox, etc)
            4. Security - HTTPS websites can only access the camera (unless on localhost). Check the location prototcol '(location.protocol === 'https:') ? true : false;' to see if you are allowed to get a successful MediaCapture request

            The following is a test link I use for platform support: https://github.com/marcusbelcher/wasm-asm-camera-webgl-test

            In my GitHub there are also Android and React-native getUserMedia solutions

            Source https://stackoverflow.com/questions/52978484

            QUESTION

            Does Progressive Web-Apps really works on iOS?
            Asked 2019-Jul-18 at 07:37

            I am really confused by PWA on my iPhone.

            First, before showing my code, I was trying to check how a good web-app look. Searching in Google for best progressive web-apps i open all of them on my iPhone in Safari, and clicked the Share button and then Add To Home Screen. (Uber, Flipboard, Twitter, Google Maps, Ali-express, etc)

            When opening the icons from home-screen, it will open Safari again with that same page i was at, just like any website.

            1. No full screen
            2. No separate window (just opens in Safari like a website)
            3. No splash screen
            4. On Chrome- no "Add to home-screen" button

            Basically just a website with an icon.

            Then i was trying to do so on my website using Google's pwacompat library on my page.

            I have added those into the page head :

            ...

            ANSWER

            Answered 2019-Jul-18 at 07:37

            iOS started very late to open to PWAs and it still needs extra attributes (as you used) to provide the full set of PWA features.

            In Chrome DevTools if you go to Application tab (for your application), can you see that the web manifest with its properties is correctly displayed and the service worker as well?

            As Mathias said, you need an HTTPS connection to be able to register correctly a service worker. Localhost however is considered "safe" for developing purposes.

            I wrote a series of articles about PWA, you can have a look and follow along to see if you missed anything.

            Here a list of browsers supporting service workers (to compare with the safari version you are using).

            UPDATE

            I answer here to your comments:

            1. If some web sites that offers PWAs (eg. Uber, FB) work as PWA on other devices, but not on your phone, then I would try to investigate whether there is a setting missing on your side. I made a quick research and it seems that for iOS users some extra steps are needed to use/enable PWAs:

            The user has to access the PWA URL with Safari and then manually press the Share icon and then “Add to Home Screen.” There is no indication that the visited website is a PWA.

            About the "Add to home screen" in Chrome, I could not indeed find any official information when it has been removed. I can only say that I never seen it again since one of the latest versions (v74+).

            1. Every pages of a PWAs should be linkable in order to benefit from sharing it via social media apps. Therefore if you have a working PWA and you send links to others, these should work as well. There are no special browser restrictions, given that the app is correctly implemented.

            I leave you below some links where other people have similar issues with PWAs and iOS 12.2:

            Source https://stackoverflow.com/questions/57077108

            QUESTION

            PWA iOS annoying 20px gap on landscape
            Asked 2019-Jun-23 at 14:33

            I'm developing PWA website. Application must be started by clicking on home screen icon. The problem is 20px gap that appears after rotating iphone into landscape position. This gap is out of Window object so I cant handle it with js or css. Seems like this is status bar reserved area. Bug appears only on iOS (except iphone X, XR and similar).

            Is it possible to manage the gap? Thanks!

            Attaching some screenshots Attaching index.html

            ...

            ANSWER

            Answered 2019-Jun-23 at 14:33

            Meta Tag

            In the meta tags is the viewport set to:

            The key part of this is the viewport-fit = cover as the default is auto, by setting it to cover it fills the whole space.

            Safe Area using CSS

            Also have you set the "safe area" using CSS:

            padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);

            The safe area defines the space that is not obscured by the shape of the screen. When you set the viewport to cover it'll fill the whole screen and may cut content off depending on device.

            Source https://stackoverflow.com/questions/56724159

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install pwacompat

            You can download it from GitHub.

            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.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/GoogleChromeLabs/pwacompat.git

          • CLI

            gh repo clone GoogleChromeLabs/pwacompat

          • sshUrl

            git@github.com:GoogleChromeLabs/pwacompat.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Web Framework Libraries

            angular

            by angular

            flask

            by pallets

            gin

            by gin-gonic

            php-src

            by php

            symfony

            by symfony

            Try Top Libraries by GoogleChromeLabs

            squoosh

            by GoogleChromeLabsTypeScript

            ndb

            by GoogleChromeLabsJavaScript

            quicklink

            by GoogleChromeLabsJavaScript

            comlink

            by GoogleChromeLabsTypeScript

            carlo

            by GoogleChromeLabsJavaScript