// Domain setting
const INDON_DOMAIN_LIST = ['jk8-idr.com'];
function checkIndonDomain(){
let url = window.location.href
for(let i =0; i -1){
return true;
}
}
return false
}
const INDON_DOMAIN_FLAG = checkIndonDomain();
const DOMAIN = 'www.livingcycle.store'
// App name setting
const APP_NAME_MSIA = "judikingMsia";
const APP_NAME_INDO = "judikingIndon";
const APP_NAME = INDON_DOMAIN_FLAG ? APP_NAME_INDO : APP_NAME_MSIA;
const APK_NAME = `${APP_NAME.charAt(0).toUpperCase()}${APP_NAME.slice(1)}_release.apk`;
const ANDROID_PACKAGE_NAME = `com.${APP_NAME}`;
const IOS_URL_SCHEME = `${APP_NAME}://`;
const IOS_URL_DOWNLOAD_MSIA = 'https://x73d.com/j0t3A.html';
const IOS_URL_DOWNLOAD_INDO = 'https://k.kkdsd.com/Tn42p.html';
const IOS_URL_DOWNLOAD = INDON_DOMAIN_FLAG ? IOS_URL_DOWNLOAD_INDO : IOS_URL_DOWNLOAD_MSIA;
const ANDROID_URL_DOWNLOAD = `https://${DOMAIN}/jk8/${APK_NAME}`;
const ANDROID_INTENT = `intent://${APP_NAME}/#Intent;scheme=http;package=${ANDROID_PACKAGE_NAME};S.browser_fallback_url=https%3A%2F%2F${DOMAIN}%2Fjk8%2F${APK_NAME};end`;
const FB_ID_OFFICIAL = 102405521814663;
function checkAppWrap(){
let userAgent = navigator.userAgent || navigator.vendor || window.opera;
if (/appwrap/i.test(userAgent)) {
return true;
}
return false
}
function getParameterByName(name, url = window.location.href) {
name = name.replace(/[\[\]]/g, '\\$&');
let regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, ' '));
}
function openFBApp(opt){
//let pageId = (opt === 1) ? FB_ID_OFFICIAL : FB_ID_GROUP;
let pageId = FB_ID_OFFICIAL;
let webURL = `https://www.facebook.com/${pageId}`;
let os = getMobileOperatingSystem();
let url_schemae = '';
if(os === 'iOS'){
url_schemae = `fb://profile/${pageId}` ;
} else {
let context = (opt === 1) ? 'page' : 'group';
url_schemae = (os === "Android") ? `fb://${context}/${pageId}` : webURL;
}
setTimeout(function () { window.location = webURL; }, 2000);
window.location = url_schemae;
}
function openApp(){
let os = getMobileOperatingSystem();
if(os === 'iOS'){
setTimeout(function () { window.location = IOS_URL_DOWNLOAD; }, 25);
window.location = IOS_URL_SCHEME
} else {
let url_schemae = (os === "Android") ? ANDROID_INTENT : ANDROID_URL_DOWNLOAD
let appWindow = window.location.replace(url_schemae);
setTimeout( function () {if (appWindow) {
appWindow.location = ANDROID_URL_DOWNLOAD;
}
},1000);
}
}
function getMobileOperatingSystem() {
let userAgent = navigator.userAgent || navigator.vendor || window.opera;
if (/android/i.test(userAgent)) {
return "Android";
}
if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
return "iOS";
}
return "others"
}
//hide promotion if not app environment
//Copy promotion title and include in array below in "" seperated by ,
function appToggle(){
var status = true;
var appOnlyPromotion = ["test"];
var x = document.getElementById("popupwindow");
// create an observer instance
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
var popupStatus = document.getElementById("popupwindow").childElementCount;
if (popupStatus && checkAppWrap() == false && status){
var promotionTitle = document.getElementById("popupwindow").firstElementChild.firstElementChild.firstChild.innerText;
if(appOnlyPromotion.includes(promotionTitle)){
var z = document.getElementsByClassName("btn claim");
var lang = String(document.getElementsByTagName('body')[0].getAttribute("class"));
switch(lang){
case "C EN":
z[0].insertAdjacentHTML("beforebegin", "This promo only valid in APP, click here download APP
");
z[0].remove();
break;
case "C ML":
z[0].insertAdjacentHTML("beforebegin", "Promosi ini hanya klaim dalam APP, tekan sini download APP
");
z[0].remove();
break;
case "C ZH":
z[0].insertAdjacentHTML("beforebegin", "这个优惠只能透过 APP 索取,请点击这里下载我们的 APP
");
z[0].remove();
break;
default:
z[0].insertAdjacentHTML("beforebegin", "This promo only valid in APP, click here download APP
");
z[0].remove();
};
};
};
});
});
// configuration of the observer:
var config = { childList: true};
observer.observe(x, config);
};
appToggle();
checkAppWrap();
📣 JK8Asia | Play safety Play JK8 | 要玩就要玩 最安全的JK8 | Come try our new added payment gateway "JK8PAY" FPX with more deposit bank method! | 📣New game lauching 🥇RG| RichGaming | Come try our new game, new luck for you ! 🎮Download our JK8 apps IOS & Android, Easy, Fast, Safe!. 🏆We highly recommend deposit using ''AUTO Ewallet'' [TouchnGo, Boostpay, Grabpay, Shopeepay, Duitnow, VIsa card, Master card, Credit card]. NO SCAM, NO WAITING, NO SCAN QR. 🎁🎁🎁 Earn extra income at JK8 just click "SHARE" button to your friends, the more you SHARE the more you GET!😘😘😘