Update content of files

This commit is contained in:
GitHub Action 2023-08-26 13:42:46 +00:00
parent ab34866d43
commit 4e43a2492c
3 changed files with 4 additions and 7 deletions

View file

@ -125,15 +125,14 @@
if (eventData === undefined) {
eventData = '';
}
console.log('[Telegram.WebView] > postEvent', eventType, eventData);
if (window.TelegramWebviewProxy !== undefined) {
TelegramWebviewProxy.postEvent(eventType, JSON.stringify(eventData));
console.log('[Telegram.WebView] > postEvent via TelegramWebviewProxy', eventType, eventData);
callback();
}
else if (window.external && 'notify' in window.external) {
window.external.notify(JSON.stringify({eventType: eventType, eventData: eventData}));
console.log('[Telegram.WebView] postEvent via external.notify', eventType, eventData);
callback();
}
else if (isIframe) {
@ -142,20 +141,18 @@
// For now we don't restrict target, for testing purposes
trustedTarget = '*';
window.parent.postMessage(JSON.stringify({eventType: eventType, eventData: eventData}), trustedTarget);
console.log('[Telegram.WebView] postEvent via postMessage', eventType, eventData);
callback();
} catch (e) {
callback(e);
}
}
else {
console.log('[Telegram.WebView] postEvent', eventType, eventData);
callback({notAvailable: true});
}
};
function receiveEvent(eventType, eventData) {
console.log('[Telegram.WebView] receiveEvent', eventType, eventData);
console.log('[Telegram.WebView] < receiveEvent', eventType, eventData);
callEventCallbacks(eventType, function(callback) {
callback(eventType, eventData);
});

View file

@ -9,7 +9,7 @@
<meta name="MobileOptimized" content="176" />
<meta name="HandheldFriendly" content="True" />
<meta name="robots" content="noindex, nofollow" />
<script src="https://tg.dev/js/telegram-web-app.js?32"></script>
<script src="https://tg.dev/js/telegram-web-app.js?33"></script>
<script>
function setThemeClass() {
document.documentElement.className = Telegram.WebApp.colorScheme;

View file

@ -8,7 +8,7 @@
<meta name="MobileOptimized" content="176" />
<meta name="HandheldFriendly" content="True" />
<meta name="robots" content="noindex,nofollow" />
<script src="https://tg.dev/js/telegram-web-app.js?32"></script>
<script src="https://tg.dev/js/telegram-web-app.js?33"></script>
<script>
function setThemeClass() {
document.documentElement.className = Telegram.WebApp.colorScheme;