PHP Classes

File: resources/app.js

Recommend this page to a friend!
  Classes of Steeven Lim  >  o2system  >  resources/app.js  >  Download  
File: resources/app.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: o2system
Start projects using the with O2System Framework
Author: By
Last change:
Date: 1 year ago
Size: 940 bytes
 

Contents

Class file image Download
/**
 * This file is part of the O2System Framework package.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @author         Steeve Andrian Salim
 * @copyright      Copyright (c) Steeve Andrian Salim
 */
// ------------------------------------------------------------------------

import "./app.scss";

if ('serviceWorker' in navigator) {
    navigator.serviceWorker
        .register('/service-worker.js')
        .then(function(registration) {
            console.info(
                'Service Worker registration successful with scope: ',
                registration.scope
            );
        })
        .catch(function(err) {
            console.error('Service Worker registration failed: ', err);
        });
} else {
    console.error('Service Worker registration failed, insecure page, please serve your page over HTTPS or use localhost');
}
For more information send a message to info at phpclasses dot org.