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

@pwabuilder/pwa-simulator

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pwabuilder/pwa-simulator

Web component that simulates your PWA's experience on any platform

  • 0.0.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

PWABuilder: pwa-simulator

A web component that allows you to preview your PWA on Windows 11, based on your app's manifest.json file!

Built with

Using this component

Modes

The pwa-simulator can be used in 2 ways:

  1. You can enter the PWA's URL in the initially rendered form, and via the pwabuilder-manifest-finder API, the component fetches the corresponding web manifest.
  2. The site's URL can be passed as a property to the component, together with the web manifest. Note that the PWA's URL is still needed in this mode to display the icons and other images.

Configuration

All properties are optional and have default values, but for the optimal experience these should be modified as needed. Note that in the HTML markup, property names should be all in lowercase. For more information refer to lit's documentation.

  • siteUrl: The PWA's URL. If not defined, the component will initially display a form to input the site's URL (see mode 1 above).
  • manifest: The input manifest object. The siteUrl property should be defined if a manifest is given as input.
    • Default:
    {
      name: 'PWA App',
      background_color: '#FFF',
      theme_color: '#E3CEF6',
      categories: [],
      shortcuts: [],
      display: 'standalone',
      description: 'An amazing progressive web app!',
      icons: [
        {
          src: '/assets/icons/icon_512.png',
          sizes: '512x512',
          type: 'image/png'
        }
      ]
    }
    
  • hideEditor: If true, the code editor is hidden and only the preview window is displayed.
    • Default: false
  • explanations: Object containing the explanation messages that are displayed when the user interacts with the previewer. initial is the starting message (can be used to suggest an initial action to the user). appWindow, startMenu, jumpList and store are all shown when the respective window is open. If a value isn't specified, the default message is used.
    • Default:
    {
      initial: "Do you see something familiar on the taskbar?",
      appWindow: "The background color, theme color and display attributes determine several UI aspects of your PWA, such as the titlebar.",
      startMenu: "The application's name and icon are used in the start menu.",
      jumpList: "The actions listed on the shortcuts attribute define a context menu that is displayed when right-clicking on the taskbar icon.",
      store: "Screenshots, a complete description and categories will enhance your app's listing in the Microsoft Store."
    }
    
  • explanationDisplayTime: The duration (in milliseconds) of the explanation message display, after which it fades out.
    • Default: 5000 (5 seconds)

Styling

This component can also be styled according to the needs of your application.

The simulator exposes the parts below for customization with the CSS ::part() pseudo-element:

Part nameDescription
backgroundThe simulator's main container.
contentThe container of both the text editor and platform window.
input-formThe form for entering the PWA's URL.
input-titleThe title of the form for entering the PWA's URL.
input-fieldThe text field for entering the PWA's URL.
input-buttonThe button that submits the form for entering the PWA's URL.
status-messageThe text that announces changes in the preview manifest.

The following CSS variables can also be provided:

Variable nameDescriptionDefault
--font-familyThe component's main font family.Arial
--font-colorThe component's main font color.#292C3A
--backgroundThe CSS background of the entire component.linear-gradient(252.83deg, #5039A8 2.36%, #6AA2DB 99.69%)
--pwa-background-colorFallback background color to use in case it is not defined in the manifest.#FFF
--pwa-theme-colorFallback theme color to use in case it is not defined in the manifest.#E3CEF6

Keywords

FAQs

Package last updated on 16 Aug 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

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