
    
import {Workbox} from '../../../../site/twig/templates/v3/assets/PWA/workbox-v4.1.0/workbox-window.prod.mjs';




if ('serviceWorker' in navigator) {

    //Enable push notification
    /*
    if ('Notification' in window) {
        Notification.requestPermission(status => {
            // status will either be 'default', 'granted' or 'denied'
            console.log(`Notification permissions have been ${status}`);
        });
    }
*/

// import {StaleWhileRevalidate} from 'workbox-strategies';

/* ---- new style management ------*/


    //Register service worker
    window.addEventListener('load', () => {
        
        //const wb = new Workbox('../../../../site/twig/templates//assets/PWA/default.htm', {scope: '../../../../default.htm'});
        //const wb = new Workbox(window.PATH + '/service-worker.php', {scope: '../../../../default.htm'});
        
        //console.log("event:load");
        const wb = new Workbox('' + '/service-worker.php', {scope: '../../../../default.htm'});


        wb.register();
        
    });

}

