New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@khmyznikov/pwa-install

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@khmyznikov/pwa-install

PWA install dialog provide more convenience user experience and fix lack of native dialogs in some browsers.

0.0.8
Source
npm
Version published
Maintainers
1
Created
Source

Published on NPM

<pwa-install>

Installation dialog for Progressive web component. Provides more convenience user experience and fix lack of native dialogs in some browsers. 13.5kB brotli compressed bundle.

iOSiOS installiOS gallery
IMG_0345-minIMG_1541-minIMG_0346-min
AndroidAndroid galleryDark theme
Screenshot_20210619-152257-minScreenshot_20210619-152248-minScreenshot_20210619-151933-min
ChromeChrome gallery
Screenshot 2021-06-19 153758-minScreenshot 2021-06-19 153810-min

Install

npm i @khmyznikov/pwa-install

Alternatively, you can use unpkg.

Import

import '../node_modules/@khmyznikov/pwa-install/dist/bundle.js';

Use

<pwa-install></pwa-install>

Demo

Supported params

<pwa-install       
  manifest-url="/manifest.json"
  name="PWA"
  description="Progressive web application"
  icon="/icon.png">
</pwa-install>

Make a good manifest file and don't use name/descr/icon params

Supported events

  • pwa-install-success-event
  • pwa-install-fail-event
  • pwa-install-available-event
  • pwa-user-choice-result-event
<script type="text/javascript">
  var pwaInstall = document.getElementsByTagName('pwa-install')[0];

  pwaInstall.addEventListener('pwa-install-success-event', (event) => {console.log(event.detail.message)});
</script>

Supported properties (readonly)

  • userChoiceResult: string;
  • isDialogHidden: boolean
  • isInstallAvailable: boolean
  • isAppleMobilePlatform: boolean
  • isUnderStandaloneMode: boolean
  • isRelatedAppsInstalled: boolean
<script type="text/javascript">
  var pwaInstall = document.getElementsByTagName('pwa-install')[0];

  console.log(pwaInstall.isUnderStandaloneMode);
</script>

Supported methods

  • install
  • hideDialog
  • showDialog
  • getInstalledRelatedApps: async
<script type="text/javascript">
  var pwaInstall = document.getElementsByTagName('pwa-install')[0];

  pwaInstall.install();
</script>

ROADMAP

  • more params/methods/events
  • translation
  • manual mode
  • style customization

Keywords

PWA

FAQs

Package last updated on 19 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts