mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2024-12-26 06:20:27 +01:00
Update content of files
This commit is contained in:
parent
7b57550d09
commit
ab34866d43
3 changed files with 7 additions and 8 deletions
|
@ -128,10 +128,12 @@
|
||||||
|
|
||||||
if (window.TelegramWebviewProxy !== undefined) {
|
if (window.TelegramWebviewProxy !== undefined) {
|
||||||
TelegramWebviewProxy.postEvent(eventType, JSON.stringify(eventData));
|
TelegramWebviewProxy.postEvent(eventType, JSON.stringify(eventData));
|
||||||
|
console.log('[Telegram.WebView] > postEvent via TelegramWebviewProxy', eventType, eventData);
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
else if (window.external && 'notify' in window.external) {
|
else if (window.external && 'notify' in window.external) {
|
||||||
window.external.notify(JSON.stringify({eventType: eventType, eventData: eventData}));
|
window.external.notify(JSON.stringify({eventType: eventType, eventData: eventData}));
|
||||||
|
console.log('[Telegram.WebView] postEvent via external.notify', eventType, eventData);
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
else if (isIframe) {
|
else if (isIframe) {
|
||||||
|
@ -140,23 +142,20 @@
|
||||||
// For now we don't restrict target, for testing purposes
|
// For now we don't restrict target, for testing purposes
|
||||||
trustedTarget = '*';
|
trustedTarget = '*';
|
||||||
window.parent.postMessage(JSON.stringify({eventType: eventType, eventData: eventData}), trustedTarget);
|
window.parent.postMessage(JSON.stringify({eventType: eventType, eventData: eventData}), trustedTarget);
|
||||||
if (initParams.tgWebAppDebug) {
|
console.log('[Telegram.WebView] postEvent via postMessage', eventType, eventData);
|
||||||
console.log('[Telegram.WebView] postEvent via postMessage', eventType, eventData);
|
|
||||||
}
|
|
||||||
callback();
|
callback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
callback(e);
|
callback(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (initParams.tgWebAppDebug) {
|
console.log('[Telegram.WebView] postEvent', eventType, eventData);
|
||||||
console.log('[Telegram.WebView] postEvent', eventType, eventData);
|
|
||||||
}
|
|
||||||
callback({notAvailable: true});
|
callback({notAvailable: true});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function receiveEvent(eventType, eventData) {
|
function receiveEvent(eventType, eventData) {
|
||||||
|
console.log('[Telegram.WebView] receiveEvent', eventType, eventData);
|
||||||
callEventCallbacks(eventType, function(callback) {
|
callEventCallbacks(eventType, function(callback) {
|
||||||
callback(eventType, eventData);
|
callback(eventType, eventData);
|
||||||
});
|
});
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<meta name="MobileOptimized" content="176" />
|
<meta name="MobileOptimized" content="176" />
|
||||||
<meta name="HandheldFriendly" content="True" />
|
<meta name="HandheldFriendly" content="True" />
|
||||||
<meta name="robots" content="noindex, nofollow" />
|
<meta name="robots" content="noindex, nofollow" />
|
||||||
<script src="https://tg.dev/js/telegram-web-app.js?31"></script>
|
<script src="https://tg.dev/js/telegram-web-app.js?32"></script>
|
||||||
<script>
|
<script>
|
||||||
function setThemeClass() {
|
function setThemeClass() {
|
||||||
document.documentElement.className = Telegram.WebApp.colorScheme;
|
document.documentElement.className = Telegram.WebApp.colorScheme;
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<meta name="MobileOptimized" content="176" />
|
<meta name="MobileOptimized" content="176" />
|
||||||
<meta name="HandheldFriendly" content="True" />
|
<meta name="HandheldFriendly" content="True" />
|
||||||
<meta name="robots" content="noindex,nofollow" />
|
<meta name="robots" content="noindex,nofollow" />
|
||||||
<script src="https://tg.dev/js/telegram-web-app.js?31"></script>
|
<script src="https://tg.dev/js/telegram-web-app.js?32"></script>
|
||||||
<script>
|
<script>
|
||||||
function setThemeClass() {
|
function setThemeClass() {
|
||||||
document.documentElement.className = Telegram.WebApp.colorScheme;
|
document.documentElement.className = Telegram.WebApp.colorScheme;
|
||||||
|
|
Loading…
Reference in a new issue