aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.html6
-rw-r--r--modules/core/module-loader.js2
-rw-r--r--modules/ext/webdav.js18
3 files changed, 21 insertions, 5 deletions
diff --git a/main.html b/main.html
index 2939f74..1491a7a 100644
--- a/main.html
+++ b/main.html
@@ -1349,13 +1349,13 @@
</script>
<!-- v4.5.63: A2A scratchpad fixes + agent-register arg fix -->
-<script src="modules/core/core-bundle.js?v=v4.6.144"></script>
+<script src="modules/core/core-bundle.js?v=v4.6.145"></script>
<!-- Async dependency-ordered module loader now only initializes terminal and loads optional ext modules -->
-<script src="modules/core/module-loader.js?v=v4.6.144"></script>
+<script src="modules/core/module-loader.js?v=v4.6.145"></script>
<!-- Critical ext bundle loads AFTER webx11 exists so registerModule calls work -->
-<script src="modules/ext/critical-ext-bundle.js?v=v4.6.144"></script>
+<script src="modules/ext/critical-ext-bundle.js?v=v4.6.145"></script>
<script>
// ═══ ONE TRUE VERSION SOURCE ═══
diff --git a/modules/core/module-loader.js b/modules/core/module-loader.js
index 2cb5003..ffa691e 100644
--- a/modules/core/module-loader.js
+++ b/modules/core/module-loader.js
@@ -4,7 +4,7 @@
// Core module bundle loaded synchronously in main.html.
// This loader only handles version cache-busting, splash, terminal init, and optional ext modules.
- const LATEST_VER = 'v4.6.144';
+ const LATEST_VER = 'v4.6.145';
const CACHE = '?v=' + LATEST_VER;
// Exposed so ext modules can register their own URL with the same cache-busting version
// instead of an unversioned path the browser may already have cached (shell.js did).
diff --git a/modules/ext/webdav.js b/modules/ext/webdav.js
index c7efbf9..a97a8bc 100644
--- a/modules/ext/webdav.js
+++ b/modules/ext/webdav.js
@@ -975,6 +975,13 @@ class WebDAVModule {
}
};
const mount = document.getElementById('wdav-tg-mount');
+ // A Telegram widget cannot log anyone in inside an Android WebView or an in-app
+ // browser: it needs a popup that can postMessage back to the opener, and those hosts
+ // hand the link to the system browser, which has no opener. Measured 2026-11-02 (the
+ // operator's phone UA ends "...; wv)"): every attempt landed in Chrome and died there.
+ // In that case skip the widget entirely and start the code flow, which needs no popup.
+ const _tgWV = /;\s*wv\)/.test(navigator.userAgent || '') ||
+ /\bTelegram\b/i.test(navigator.userAgent || '');
const tw = document.createElement('script');
tw.src = 'https://telegram.org/js/telegram-widget.js?22';
tw.setAttribute('data-telegram-login', 'roducbot');
@@ -982,7 +989,16 @@ class WebDAVModule {
tw.setAttribute('data-onauth', 'webx11TgLogin(user)');
tw.setAttribute('data-request-access', 'write');
tw.async = true;
- mount.appendChild(tw);
+ if (_tgWV) {
+ // The code button's handler is already bound above; just hide the widget and use it.
+ if (mount) mount.style.display = 'none';
+ const _st = document.getElementById('wdav-tg-status');
+ if (_st) _st.textContent = 'This app window cannot run the Telegram button — using a code instead.';
+ const _cb = document.getElementById('wdav-code-btn');
+ if (_cb) setTimeout(function () { _cb.click(); }, 0);
+ } else {
+ mount.appendChild(tw);
+ }
document.getElementById('wdav-login-btn').onclick = async function () {
const u = (document.getElementById('wdav-user').value || '').trim().toLowerCase();
const pw = document.getElementById('wdav-pass').value || '';