get-web-manifest
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

get-web-manifest

Obtain the manifest for the current page

Why?

There are a number of reasons why you might want to access the manifest of the current page. I wrote this because I'm interested in using Web Share Target, and the spec explicitly permits customization of the registration mechanism. By connecting multiple applications to the same sharing system, users of any app will be able to share data with any other application, even on browsers that don't yet support Web Share.

Installation

npm install --save get-web-manifest

Usage

get-web-manifest will use a custom fetch function if given; for example, if you want to use a polyfill, pass it as an argument. If no polyfill is given then it will fall back to window.fetch.

// Supplying your own polyfill
import fetch from 'isomorphic-fetch';
import getWebManifest from 'get-web-manifest';

export async function doSomething() {
  await getWebManifest({
    fetch: fetch,
  });
}
// Relying on `window.fetch`
import getWebManifest from 'get-web-manifest';

export async function doSomething() {
  await getWebManifest();
}

Readme

Keywords

none

Package Sidebar

Install

npm i get-web-manifest

Weekly Downloads

1

Version

1.0.1

License

none

Unpacked Size

4.47 kB

Total Files

8

Last publish

Collaborators

  • ryaninvents