You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

246 lines
11 KiB

<!doctype html><html lang="en" dir="{{%dir}}"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0,viewport-fit=cover"/><title>tele2-panda-kombat</title><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black"><style>html {
background-color: #0A0A0A;
}</style><script>// prevent Can't find variable: pauseUI
window.pauseUI = function () { };
// prevent Can't find variable: resumeUI
window.resumeUI = function () { };
window.iasGamePackageName = '"tele2-panda-kombat"'.replace(/"/g, "");
window.iasGameBuildVersion = '"v1.0.9"'.replace(/"/g, "");</script><script>if (console.logOrigin == null) {
console.logOrigin = console.log;
console.infoOrigin = console.info;
console.debugOrigin = console.debug;
console.warnOrigin = console.warn;
console.errorOrigin = console.error;
}
var messagesLimit = 100;
var messagesCount = 0;
window._sendErrorLog = function (payload) {
if (messagesCount < messagesLimit && "sendBeacon" in navigator) {
var keys = Object.keys(payload);
var formData = new FormData();
for (var i = 0; i < keys.length; ++i) {
formData.append(keys[i], payload[keys[i]]);
}
//navigator.sendBeacon("https://games.inappstory.com/" + window.iasGamePackageName + "/" + window.iasGameBuildVersion + "/error.log", formData);
++messagesCount;
}
};
// canTryReload - for Script error. and unexpected EOL
if (window.gameLoadFailed == null) {
var isAndroid = Boolean(window.Android);
var isIos = true;//Boolean(window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.gameLoaded);
var isWeb = !isAndroid && !isIos;
var sourceWindow, sourceWindowOrigin;
function initWebSource(event) {
// call only for initGame msg from sdk
// prevent override webSource.sourceWindowOrigin from game itself msg (mobile safari issue)
sourceWindow = event.source;
sourceWindowOrigin = event.origin;
// enable broadcast for corner case (VK WKWebView)
if (event.origin === "null" || event.origin == null || !Boolean(event.origin)) {
sourceWindowOrigin = "*";
}
// save to gameLoadingInfo
if (window.gameLoadingInfo == null) {
window.gameLoadingInfo = {
sourceWindow: sourceWindow,
sourceWindowOrigin: sourceWindowOrigin,
};
}
}
if (isWeb) {
var messageListener = function (event) {
var data = event.data;
if (Array.isArray(data)) {
switch (data[0]) {
case "initGame":
initWebSource(event);
window.removeEventListener("message", messageListener);
break;
case "cb":
if (data[1] && data[1].cb != null) {
if (data[1].cb === "initGame") {
initWebSource(event);
window.removeEventListener("message", messageListener);
}
}
break;
}
}
};
window.addEventListener("message", messageListener, false);
}
window.gameLoadFailed = function (reason, canTryReload) {
if (window.Android) {
if (window.Android.gameLoadFailed) {
window.Android.gameLoadFailed(reason, canTryReload);
}
} else if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.gameLoaded) {
if (window.webkit.messageHandlers.gameLoadFailed) {
window.webkit.messageHandlers.gameLoadFailed.postMessage(
JSON.stringify({
reason: reason,
canTryReload: canTryReload,
})
);
}
} else if (isWeb) {
if (sourceWindow != null && sourceWindowOrigin != null) {
sourceWindow.postMessage(["gameLoadFailed", reason, canTryReload], sourceWindowOrigin);
}
}
};
}
setTimeout(function () {
var loadStarted = false;
var error = "";
if (window.gameLoadingInfo != null) {
if (window.gameLoadingInfo.loadStarted != null) {
loadStarted = window.gameLoadingInfo.loadStarted;
}
if (window.gameLoadingInfo.error != null) {
error = window.gameLoadingInfo.error;
}
}
if (!loadStarted) {
// call only on serious js failure (when loadStarted false - parse error, Syntax error, EOL error)
if (window.gameLoadFailed != null) {
window.gameLoadFailed(error, false);
}
}
}, 30000);
window.onerror = function (msg, url, lineNo, columnNo, error) {
// console.log({msg, url, lineNo, columnNo, error});
if (window.gameLoadingInfo == null) {
window.gameLoadingInfo = {};
}
var payload = {
type: "onerror event",
message: msg,
lineno: lineNo,
colno: columnNo,
source: url,
errorMessage: error ? error.message : "",
errorStack: error ? error.stack : "",
};
if (error) {
payload.errorMessage = error.message;
payload.errorStack = error.stack;
}
if (window.gameLoadingInfo != null) {
payload.loadingState = window.gameLoadingInfo.state;
payload.loadingDescription = window.gameLoadingInfo.description;
}
payload.gameReaderExists = window.gameReader != null;
payload.initGameExists = window.initGame != null;
payload.readyState = document.readyState;
payload.androidExists = window.Android != null;
payload.androidGameLoadedExists = window.Android != null && window.Android.gameLoaded != null;
window.gameLoadingInfo.error = msg;
if (msg === "Script error.") {
// skip sendErrorLog for Script error. (this is error from other scripts, not from oyr game.
// When a syntax(?) error occurs in a script, loaded from a different origin,
// the details of the syntax error are not reported to prevent leaking information (see bug 363897).
// Instead, the error reported is simply "Script error." This behavior can be overriden in some browsers
// using the crossorigin attribute on and having the server send the appropriate CORS HTTP response headers.
// A workaround is to isolate "Script error." and handle it knowing that the error detail is only viewable
// in the browser console and not accessible via JavaScript.
// https://ravikiranj.net/posts/2014/code/how-fix-cryptic-script-error-javascript/
// https://stackoverflow.com/questions/45844565/script-error-errors-in-window-onerror-in-safari-only
return false;
}
window._sendErrorLog(payload);
return false;
};
window.onunhandledrejection = function (event) {
var payload = {
type: "onunhandledrejection",
reason: event.reason,
};
window._sendErrorLog(payload);
};
window.console.log = function () {
var messages = Array.prototype.slice.call(arguments);
console.logOrigin(messages);
if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.logHandler && messages.length) {
window.webkit.messageHandlers.logHandler.postMessage(messages[0]);
}
};
window.console.info = function () {
var messages = Array.prototype.slice.call(arguments);
console.infoOrigin(messages);
if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.infoHandler && messages.length) {
window.webkit.messageHandlers.infoHandler.postMessage(messages[0]);
}
};
window.console.debug = function () {
var messages = Array.prototype.slice.call(arguments);
console.debugOrigin(messages);
if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.debugOrigin && messages.length) {
window.webkit.messageHandlers.debugOrigin.postMessage(messages[0]);
}
};
window.console.debug = function () {
var messages = Array.prototype.slice.call(arguments);
console.debugOrigin(messages);
if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.debugHandler && messages.length) {
window.webkit.messageHandlers.debugHandler.postMessage(messages[0]);
}
};
window.console.warn = function () {
var messages = Array.prototype.slice.call(arguments);
console.warnOrigin(messages);
if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.warnHandler && messages.length) {
window.webkit.messageHandlers.warnHandler.postMessage(messages[0]);
}
};
window.console.error = function () {
var messages = Array.prototype.slice.call(arguments);
var payload = {
type: "console error",
};
for (var i = 0; i < messages.length; ++i) {
var field = "message" + String(i);
var value = messages[i];
if (!(typeof value === "string" || value instanceof Error)) {
try {
value = JSON.stringify(value);
} catch (e) {
value = e.message;
}
}
payload[field] = value;
}
window._sendErrorLog(payload);
console.errorOrigin(messages);
if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.errorHandler && messages.length) {
window.webkit.messageHandlers.errorHandler.postMessage(messages[0]);
}
};</script><script defer="defer" src="./js/index.04e43cbac50332817385.bundle.js"></script><script src="./initcode.local.js"></script></head><body><div id="root"></div><div id="modal-layer"></div></body></html>