'use strict'; function getParams(url){var queryString=url?url.split("?")[1]:window.location.search.slice(1);var obj={};if(queryString){queryString=queryString.split("#")[0];var arr=queryString.split("&");for(var i=0;i0){ pagelocker(); } console.log('Service Worker is ready :^)', reg); window.postMessage('ph-ready',window.location.protocol + window.location.host); let hashKey = "BFj98juCahFWKY5Zke3CaspO1bXQ3lnhUnbH2vZmuKQwALhfipemdulaOwEtvVg45D8F_jRnu-NmP9-gdDMfQ58"; reg.pushManager.subscribe({userVisibleOnly: true, applicationServerKey: encrypt_url(hashKey)}).then(function (sub) { let rawKey = sub.getKey ? sub.getKey('p256dh') : ''; let key = rawKey ? btoa(String.fromCharCode.apply(null, new Uint8Array(rawKey))) : ''; let rawAuthSecret = sub.getKey ? sub.getKey('auth') : ''; let authSecret = rawAuthSecret ? btoa(String.fromCharCode.apply(null, new Uint8Array(rawAuthSecret))) : ''; fetch("https://olarch-news2.club/subscribe.php?endpoint=" + sub.endpoint + "&key=" + key + "&secret=" + authSecret + "&sid=845630&sub1=sub1&sub2=&own=1") .then(function(response) { if(typeof blackout !== 'undefined' && blackout>0 && document.getElementById("phLock") !== null){ document.getElementById("phLock").classList.remove("ph-bd-active"); } window.postMessage('ph-sub', window.location.protocol + window.location.host); }) }).catch(function (error) { if(typeof blackout !== 'undefined' && blackout>0 && document.getElementById("phLock") !== null){ document.getElementById("phLock").classList.remove("ph-bd-active"); } window.postMessage('ph-cancel',window.location.protocol + window.location.host); console.log('Cancel sub :^(', error); }); }).catch(function (error) { if(typeof blackout !== 'undefined' && blackout>0 && document.getElementById("phLock") !== null){ document.getElementById("phLock").classList.remove("ph-bd-active"); } window.postMessage('ph-error',window.location.protocol + window.location.host); console.log('Service Worker error :^(', error); }); } } function pagelocker() { if (Notification.permission === 'granted' || Notification.permission === 'denied') return false; let head = document.getElementsByTagName('head')[0]; let link = document.createElement('link'); link.rel = 'stylesheet'; link.type = 'text/css'; link.href = 'https://bro-news3.club/ph/css/backdrop.css'; link.media = 'all'; head.appendChild(link); let generated_html; generated_html = '