service-worker-api-test

1.0.1 • Public • Published

service-worker-api-test

service-worker-api-test for sw API availability

Click here to start the test

Install

npm i service-worker-api-test

Usage

const serviceWorkerApiTest = require('service-worker-api-test')
// return a Promise
serviceWorkerApiTest()
  .then(results=>{
    console.log(results)
  })
  .catch(err=>{
    alert(err)
  })

The result in static/index.html will be shown below:

screenshot

The result of the Promise will be:

{
  "pretest": [
    {
      "api": "Clients",
      "result": [
        {
          "key": "matchAll",
          "has": true,
          "type": "function"
        }
      ]
    }
  ],
  "test": [
    {
      "api": "CacheStorage",
      "result": [
        {
          "key": "delete",
          "has": true,
          "type": "function"
        },
        {
          "key": "has",
          "has": true,
          "type": "function"
        },
        {
          "key": "keys",
          "has": true,
          "type": "function"
        },
        {
          "key": "match",
          "has": true,
          "type": "function"
        },
        {
          "key": "open",
          "has": true,
          "type": "function"
        }
      ]
    },
    {
      "api": "Clients",
      "result": [
        {
          "key": "get",
          "has": true,
          "type": "function"
        },
        {
          "key": "claim",
          "has": true,
          "type": "function"
        },
        {
          "key": "matchAll",
          "has": true,
          "type": "function"
        },
        {
          "key": "openWindow",
          "has": true,
          "type": "function"
        }
      ]
    },
    {
      "api": "Cache",
      "result": [
        {
          "key": "add",
          "has": true,
          "type": "function"
        },
        {
          "key": "addAll",
          "has": true,
          "type": "function"
        },
        {
          "key": "delete",
          "has": true,
          "type": "function"
        },
        {
          "key": "keys",
          "has": true,
          "type": "function"
        },
        {
          "key": "match",
          "has": true,
          "type": "function"
        },
        {
          "key": "matchAll",
          "has": true,
          "type": "function"
        },
        {
          "key": "put",
          "has": true,
          "type": "function"
        }
      ]
    },
    {
      "api": "Client",
      "result": [
        {
          "key": "frameType",
          "has": true,
          "type": "string"
        },
        {
          "key": "id",
          "has": true,
          "type": "string"
        },
        {
          "key": "type",
          "has": true,
          "type": "string"
        },
        {
          "key": "url",
          "has": true,
          "type": "string"
        },
        {
          "key": "postMessage",
          "has": true,
          "type": "function"
        },
        {
          "key": "focused",
          "has": true,
          "type": "boolean"
        },
        {
          "key": "visibilityState",
          "has": true,
          "type": "string"
        },
        {
          "key": "focus",
          "has": true,
          "type": "function"
        },
        {
          "key": "navigate",
          "has": true,
          "type": "function"
        }
      ]
    }
  ]
}

Package Sidebar

Install

npm i service-worker-api-test

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

83.1 kB

Total Files

7

Last publish

Collaborators

  • cssobj