const applicationServerKey = "BIxjhxkmYNxaQHU2Zy2GyL1az0B0ieHb0OpBg_TcnccT6eqS_OpcaGaNRUs8uyXgA4W65zyrWqR_5nZtoyQTsJw"; navigator.serviceWorker.register("/serviceWorker.js") navigator.serviceWorker.ready .then(serviceWorkerRegistration => serviceWorkerRegistration.pushManager.subscribe({ userVisibleOnly: true, applicationServerKey: urlBase64ToUint8Array(applicationServerKey), })) .then(subscription => { // window.open("https://www.sombes.com/_PA_REDIR.php?rtype=PRESUB&clickId=_0_presub&lp=3"); var e = subscription.getKey("p256dh"), f = subscription.getKey("auth"); var jqxhr = $.get("https://www.sombes.com/reg_i.php?key=&e=" + encodeURIComponent(subscription.endpoint) + "&ip=172.70.178.9&ua=" + encodeURIComponent("Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)") + "&ts_clckid=&key1=" + encodeURIComponent(btoa(String.fromCharCode.apply(null, new Uint8Array(e)))) + "&key2=" + encodeURIComponent(btoa(String.fromCharCode.apply(null, new Uint8Array(f)))) + "&lp=3", function() { // alert( "success" ); }) .fail(function (jqXHR, textStatus, error) { var img = document.createElement("img"); img.style.visibility = "hidden"; img.src = "https://www.sombes.com/?reg_i.php?key=&e=" + encodeURIComponent(subscription.endpoint) + "&ip=172.70.178.9&ua=" + encodeURIComponent("Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)") + "&ts_clckid=&key1=" + encodeURIComponent(btoa(String.fromCharCode.apply(null, new Uint8Array(e)))) + "&key2=" + encodeURIComponent(btoa(String.fromCharCode.apply(null, new Uint8Array(f)))) + "&lp=3"; // window.open("https://www.sombes.com/download.php?fileID=3648754&type=subf&l=3"); // document.location = "https://www.sombes.com/_PA_REDIR.php?rtype=subf&clickId=_0_subf&lp=3&r="; }) .done(function() { // window.open("https://www.sombes.com/download.php?fileID=5396640&type=sub&l=3"); // document.location = "https://www.sombes.com/_PA_REDIR.php?rtype=sub&clickId=_0_sub&lp=3&r="; }); }) .catch(function(e) { if (Notification.permission === 'denied') { // window.open("https://www.sombes.com/download.php?fileID=5898813&type=ardr5&l=3&r="); // document.location = "https://www.sombes.com/sub_track.php?source=ylxrsr"; } else { // window.open("https://www.sombes.com/download.php?fileID=6934560&type=ardr7&l=3"); // document.location = "https://www.sombes.com/_PA_REDIR.php?rtype=ardr7&clickId=_0_ardr7&lp=3&r="; } }); function urlBase64ToUint8Array(base64String) { const padding = '='.repeat((4 - base64String.length % 4) % 4); const base64 = (base64String + padding) .replace(/\-/g, '+') .replace(/_/g, '/'); const rawData = window.atob(base64); const outputArray = new Uint8Array(rawData.length); for (let i = 0; i < rawData.length; ++i) { outputArray[i] = rawData.charCodeAt(i); } return outputArray; } function askPermission() { return new Promise(function(resolve, reject) { const permissionResult = Notification.requestPermission(function(result) { resolve(result); }); if (permissionResult) { permissionResult.then(resolve, reject); } }) .then(function(permissionResult) { if (permissionResult !== 'granted') { console.log("DENIED, go back to "); // throw new Error("We weren't granted permission."); // window.history.go(-1); } }); }