Advertisement
moonion_nashivan

Untitled

Oct 9th, 2019
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.59 KB | None | 0 0
  1. <script>
  2.     function getMobileOperatingSystem() {
  3.         var userAgent = navigator.userAgent || navigator.vendor || window.opera;
  4.         if (/windows phone/i.test(userAgent)) return "Windows Phone";
  5.         if (/android/i.test(userAgent)) return "Android";
  6.         if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) return "iOS";
  7.         return "unknown";
  8.     }
  9.     function getParams(url) {
  10.         var params = {};
  11.         var parser = document.createElement('a');
  12.         parser.href = url;
  13.         var query = parser.search.substring(1);
  14.         var vars = query.split('&');
  15.         for (var i = 0; i < vars.length; i++) {
  16.            var pair = vars[i].split('=');
  17.            params[pair[0]] = decodeURIComponent(pair[1]);
  18.        }
  19.        return params;
  20.    };
  21.  
  22.    window.onload = function () {
  23.        var params = getParams(window.location.href);
  24.        var phone = getMobileOperatingSystem();
  25.  
  26.        var location = params.origin
  27.        if ( phone === "Android" ) location = "intent://clic.com/confirmRegistration?verifyCode="+params.verifyCode+"#Intent;scheme=clicwallet;package=com.clictechnology.pay;end"
  28.        if ( phone === "iOS" ) location = "clicwallet://clic.com/confirmRegistration??verifyCode="+params.verifyCode
  29.  
  30.        window.location = location
  31.        setTimeout(function () {
  32.            if (phone === "Android") return window.location = "https://play.google.com/store/apps/details?id=com.clictechnology.pay";
  33.            else return window.location = "https://itunes.apple.com/us/app/clic-wallet/id1457362236";
  34.        }, 1000);
  35.    }
  36. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement