Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@khmyznikov/pwa-install

Package Overview
Dependencies
Maintainers
1
Versions
47
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.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
20K
decreased by-33.44%
Maintainers
1
Weekly downloads
 
Created
Source

Published on NPM npm

<pwa-install>

Installation dialog for Progressive web application. Provides more convenience user experience and fix lack of native dialogs in some browsers. 13.5kB brotli compressed bundle. Translation/localization is supported.

Use it as Web Component with any modern framework. No polyfill is required.

iOS default      Install instructionApp gallery       
iOS example defaultiOS example install instructioniOS example gallery
iPadOS
iPadOS example white
AndroidApp gallery  White theme  
Android example defaultAndroid example galleryAndroid example white
Chrome App Gallery  
Chrome example defaultChrome example gallery

Install

npm i @khmyznikov/pwa-install

Alternatively, you can use unpkg.


Import

import '@khmyznikov/pwa-install';

Use

<pwa-install></pwa-install>

Demo


Supported params

<pwa-install
  manual-apple="true"
  manual-chrome="true"
  disable-chrome="true"

  manifest-url="/manifest.json"
  name="PWA"
  description="Progressive web application"
  install-description="Custom call to install text"           
  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>

Supported localization

At this time EN and RU languages available. Language should change automatically based on browser settings. Please create the issue if you want to help with translation to your language. It an easy process.


ROADMAP

  • style customization

Keywords

FAQs

Package last updated on 23 May 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc