Update content of files

This commit is contained in:
GitHub Action 2022-04-21 15:35:07 +00:00
parent d75ad191e7
commit b1d85fdc12
3 changed files with 13 additions and 4 deletions

View file

@ -9,7 +9,7 @@
var initParams = urlParseHashParams(locationHash); var initParams = urlParseHashParams(locationHash);
var isIframe = false; var isIframe = false, iFrameStyle;
try { try {
isIframe = (window.parent != null && window != window.parent); isIframe = (window.parent != null && window != window.parent);
if (isIframe) { if (isIframe) {
@ -23,8 +23,17 @@
if (!dataParsed || !dataParsed.eventType) { if (!dataParsed || !dataParsed.eventType) {
return; return;
} }
receiveEvent(dataParsed.eventType, dataParsed.eventData); if (dataParsed.eventType == 'set_custom_style') {
iFrameStyle.innerHTML = dataParsed.eventData;
} else {
receiveEvent(dataParsed.eventType, dataParsed.eventData);
}
}); });
iFrameStyle = document.createElement('style');
document.head.appendChild(iFrameStyle);
try {
window.parent.postMessage(JSON.stringify({eventType: 'iframe_ready'}), '*');
} catch (e) {}
} }
} catch (e) {} } catch (e) {}

View file

@ -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?1"></script> <script src="https://tg.dev/js/telegram-web-app.js?2"></script>
<script> <script>
function setThemeClass() { function setThemeClass() {
document.documentElement.className = Telegram.WebApp.colorScheme; document.documentElement.className = Telegram.WebApp.colorScheme;

View file

@ -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://telegram.org/js/telegram-web-app.js?1"></script> <script src="https://telegram.org/js/telegram-web-app.js?2"></script>
<script> <script>
function setThemeClass() { function setThemeClass() {
document.documentElement.className = Telegram.WebApp.colorScheme; document.documentElement.className = Telegram.WebApp.colorScheme;