From 3a6131aedbd40be06ff4e50ccc8ba2dad550be8e Mon Sep 17 00:00:00 2001 From: Raunak Raj <71929976+bajrangCoder@users.noreply.github.com> Date: Fri, 8 May 2026 08:29:16 +0530 Subject: [PATCH 1/5] fix: add fallback and min webview --- src/components/terminal/terminalManager.js | 25 ++++++++--- src/main.js | 8 +++- src/pages/fileBrowser/fileBrowser.js | 9 +++- src/utils/polyfill.js | 12 +++++ www/index.html | 52 ++++++++++++++++++++++ 5 files changed, 99 insertions(+), 7 deletions(-) diff --git a/src/components/terminal/terminalManager.js b/src/components/terminal/terminalManager.js index 1b88a7274..5f2d0d1ce 100644 --- a/src/components/terminal/terminalManager.js +++ b/src/components/terminal/terminalManager.js @@ -670,7 +670,7 @@ class TerminalManager { let lastWidth = 0; let lastHeight = 0; - const resizeObserver = new ResizeObserver((entries) => { + const handleResize = (entries) => { const now = Date.now(); const entry = entries && entries[0]; const cr = entry?.contentRect; @@ -706,15 +706,30 @@ class TerminalManager { console.error(`Resize error for terminal ${terminalId}:`, error); } }, RESIZE_DEBOUNCE); - }); + }; + + const resizeObserver = + typeof ResizeObserver === "function" + ? new ResizeObserver(handleResize) + : null; + let resizeFallbackInterval = null; // Wait for the terminal container to be available, then observe it setTimeout(() => { const containerElement = terminalFile.content; if (containerElement && containerElement instanceof Element) { - resizeObserver.observe(containerElement); - // store observer so we can disconnect on close - terminalFile._resizeObserver = resizeObserver; + if (resizeObserver) { + resizeObserver.observe(containerElement); + // store observer so we can disconnect on close + terminalFile._resizeObserver = resizeObserver; + } else { + resizeFallbackInterval = setInterval(() => handleResize(), 500); + terminalFile._resizeObserver = { + disconnect() { + clearInterval(resizeFallbackInterval); + }, + }; + } } else { console.warn("Terminal container not available for ResizeObserver"); } diff --git a/src/main.js b/src/main.js index 65067364a..0905edc10 100644 --- a/src/main.js +++ b/src/main.js @@ -416,11 +416,17 @@ async function setDebugInfo() { // Extract Chrome/WebView version const chromeMatch = userAgent.match(/Chrome\/([0-9.]+)/); const webviewVersion = chromeMatch ? chromeMatch[1] : "Unknown"; + const webviewMajor = Number.parseInt(webviewVersion, 10); + const minWebviewMajor = window.__ACODE_MIN_WEBVIEW_MAJOR__ || 84; + const webviewStatus = + Number.isFinite(webviewMajor) && webviewMajor < minWebviewMajor + ? ` (minimum supported: ${minWebviewMajor})` + : ""; const info = [ `App: v${version} (${versionCode})`, `Android: ${androidVersion}`, - `WebView: ${webviewVersion}`, + `WebView: ${webviewVersion}${webviewStatus}`, `Language: ${language}`, ].join("\n"); diff --git a/src/pages/fileBrowser/fileBrowser.js b/src/pages/fileBrowser/fileBrowser.js index 24408c007..4943f9bd4 100644 --- a/src/pages/fileBrowser/fileBrowser.js +++ b/src/pages/fileBrowser/fileBrowser.js @@ -830,7 +830,14 @@ function FileBrowserInclude(mode, info, doesOpenLast = true) { break; case "copyuri": - navigator.clipboard.writeText(url); + if (typeof cordova !== "undefined" && cordova?.plugins?.clipboard) { + cordova.plugins.clipboard.copy(url); + } else if (navigator.clipboard?.writeText) { + await navigator.clipboard.writeText(url); + } else { + alert(strings.error, "Clipboard is not available."); + break; + } alert(strings.success, strings["copied to clipboard"]); break; diff --git a/src/utils/polyfill.js b/src/utils/polyfill.js index 11dd85f5e..865cb54d8 100644 --- a/src/utils/polyfill.js +++ b/src/utils/polyfill.js @@ -36,6 +36,18 @@ export default function loadPolyFill() { }; } + if (!window.queueMicrotask) { + window.queueMicrotask = function (callback) { + Promise.resolve() + .then(callback) + .catch((error) => + setTimeout(() => { + throw error; + }), + ); + }; + } + if (!HTMLElement.prototype.getParent) { HTMLElement.prototype.getParent = function (queryString) { const $$ = [...document.querySelectorAll(queryString)]; diff --git a/www/index.html b/www/index.html index 1523077bb..f403955d7 100644 --- a/www/index.html +++ b/www/index.html @@ -31,6 +31,10 @@ #splash { display: none; position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; inset: 0; z-index: 999999; @@ -74,12 +78,60 @@ From fe1b010085d7fc7e952c7c2fa070e74ed1ea7e92 Mon Sep 17 00:00:00 2001 From: Raunak Raj <71929976+bajrangCoder@users.noreply.github.com> Date: Fri, 8 May 2026 08:50:09 +0530 Subject: [PATCH 2/5] fix --- src/lang/ar-ye.json | 1 + src/lang/be-by.json | 1 + src/lang/bn-bd.json | 1 + src/lang/cs-cz.json | 1 + src/lang/de-de.json | 1 + src/lang/en-us.json | 1 + src/lang/es-sv.json | 1 + src/lang/fr-fr.json | 1 + src/lang/he-il.json | 1 + src/lang/hi-in.json | 1 + src/lang/hu-hu.json | 1 + src/lang/id-id.json | 1 + src/lang/ir-fa.json | 1 + src/lang/it-it.json | 1 + src/lang/ja-jp.json | 1 + src/lang/ko-kr.json | 1 + src/lang/ml-in.json | 1 + src/lang/mm-unicode.json | 1 + src/lang/mm-zawgyi.json | 1 + src/lang/pl-pl.json | 1 + src/lang/pt-br.json | 1 + src/lang/pu-in.json | 1 + src/lang/ru-ru.json | 1 + src/lang/tl-ph.json | 1 + src/lang/tr-tr.json | 1 + src/lang/uk-ua.json | 1 + src/lang/uz-uz.json | 1 + src/lang/vi-vn.json | 1 + src/lang/zh-cn.json | 1 + src/lang/zh-hant.json | 1 + src/lang/zh-tw.json | 1 + src/pages/fileBrowser/fileBrowser.js | 6 ++++- www/index.html | 40 +++++++++++++++++++++------- 33 files changed, 66 insertions(+), 11 deletions(-) diff --git a/src/lang/ar-ye.json b/src/lang/ar-ye.json index badff67b7..d3f13b411 100644 --- a/src/lang/ar-ye.json +++ b/src/lang/ar-ye.json @@ -209,6 +209,7 @@ "app settings": "إعدادات التطبيق", "disable in-app-browser caching": "تعطيل التخزين المؤقت للمتصفح الداخلي", "copied to clipboard": "تم النسخ إلى الحافظة", + "clipboard not available": "Clipboard is not available.", "remember opened files": "تذكر الملفات المفتوحة", "remember opened folders": "تذكر المجلدات المفتوحة", "no suggestions": "بدون اقتراحات", diff --git a/src/lang/be-by.json b/src/lang/be-by.json index c70f7c03c..f0dceb3dd 100644 --- a/src/lang/be-by.json +++ b/src/lang/be-by.json @@ -210,6 +210,7 @@ "disable in-app-browser caching": "Адключыць кэшаванне ў праграмным сродку агляду", "Should use Current File For preview instead of default (index.html)": "Для папярэдняга прагляду варта выкарыстоўваць бягучы файл замест прадвызначанага (index.html)", "copied to clipboard": "Скапіявана ў буфер абмену", + "clipboard not available": "Clipboard is not available.", "remember opened files": "Запамінаць адкрытыя файлы", "remember opened folders": "Запамінаць адкрытыя каталогі", "no suggestions": "Няма прапаноў", diff --git a/src/lang/bn-bd.json b/src/lang/bn-bd.json index b4f677755..3544aab31 100644 --- a/src/lang/bn-bd.json +++ b/src/lang/bn-bd.json @@ -209,6 +209,7 @@ "app settings": "অ্যাপ সেটিংস", "disable in-app-browser caching": "ইন-অ্যাপ ব্রাউজারের ক্যাশ বন্ধ করুন", "copied to clipboard": "ক্লিপবোর্ডে কপি করা হয়েছে", + "clipboard not available": "Clipboard is not available.", "remember opened files": "খোলা ফাইলগুলো মনে রাখুন", "remember opened folders": "খোলা ফোল্ডারগুলো মনে রাখুন", "no suggestions": "কোনো পরামর্শ নেই", diff --git a/src/lang/cs-cz.json b/src/lang/cs-cz.json index c2459c344..6041a79b2 100644 --- a/src/lang/cs-cz.json +++ b/src/lang/cs-cz.json @@ -209,6 +209,7 @@ "app settings": "Nastavení aplikace", "disable in-app-browser caching": "Zakázat ukládání do mezipaměti v prohlížeči aplikace", "copied to clipboard": "Zkopírováno do schránky", + "clipboard not available": "Clipboard is not available.", "remember opened files": "Zapamatovat si otevřené soubory", "remember opened folders": "Zapamatovat si otevřené složky", "no suggestions": "Žádné návrhy", diff --git a/src/lang/de-de.json b/src/lang/de-de.json index de439f5a5..5e7fc33a1 100644 --- a/src/lang/de-de.json +++ b/src/lang/de-de.json @@ -209,6 +209,7 @@ "app settings": "App-Einstellungen", "disable in-app-browser caching": "In-App-Browser-Cache abschalten", "copied to clipboard": "In die Zwischenablage kopiert", + "clipboard not available": "Clipboard is not available.", "remember opened files": "Geöffnete Dateien merken", "remember opened folders": "Geöffnete Ordner merken", "no suggestions": "Keine Vorschläge", diff --git a/src/lang/en-us.json b/src/lang/en-us.json index 431fcfa97..b8f5b87e0 100644 --- a/src/lang/en-us.json +++ b/src/lang/en-us.json @@ -211,6 +211,7 @@ "app settings": "App settings", "disable in-app-browser caching": "Disable in-app-browser caching", "copied to clipboard": "Copied to clipboard", + "clipboard not available": "Clipboard is not available.", "remember opened files": "Remember opened files", "remember opened folders": "Remember opened folders", "no suggestions": "No suggestions", diff --git a/src/lang/es-sv.json b/src/lang/es-sv.json index 0e2fd34be..db88215e1 100644 --- a/src/lang/es-sv.json +++ b/src/lang/es-sv.json @@ -209,6 +209,7 @@ "app settings": "Ajustes de aplicacion", "disable in-app-browser caching": "Desactivar el almacenamiento en caché de la aplicación en el navegador", "copied to clipboard": "Copiado al portapapeles", + "clipboard not available": "Clipboard is not available.", "remember opened files": "Recordar archivos abiertos", "remember opened folders": "Recordar carpetas abiertas", "no suggestions": "No hay sugerencias", diff --git a/src/lang/fr-fr.json b/src/lang/fr-fr.json index eaca49f5d..55cc649dd 100644 --- a/src/lang/fr-fr.json +++ b/src/lang/fr-fr.json @@ -209,6 +209,7 @@ "app settings": "Paramètres de l'application", "disable in-app-browser caching": "Désactiver la mise en cache dans le navigateur de l'application", "copied to clipboard": "Copié dans le presse-papiers", + "clipboard not available": "Clipboard is not available.", "remember opened files": "Mémoriser les fichiers ouverts", "remember opened folders": "Mémoriser les dossiers ouverts", "no suggestions": "Aucune suggestion", diff --git a/src/lang/he-il.json b/src/lang/he-il.json index 1d3d487e9..23a198b9c 100644 --- a/src/lang/he-il.json +++ b/src/lang/he-il.json @@ -210,6 +210,7 @@ "disable in-app-browser caching": "השבתת אחסון במטמון בדפדפן בתוך האפליקציה", "Should use Current File For preview instead of default (index.html)": "יש להשתמש בקובץ הנוכחי לתצוגה מקדימה במקום ברירת המחדל (index.html)", "copied to clipboard": "הועתק", + "clipboard not available": "Clipboard is not available.", "remember opened files": "זכור קבצים שנפתחו", "remember opened folders": "זכור תקיות שנפתחו", "no suggestions": "אין הצעות", diff --git a/src/lang/hi-in.json b/src/lang/hi-in.json index c15d7ea3a..84fd90d66 100644 --- a/src/lang/hi-in.json +++ b/src/lang/hi-in.json @@ -210,6 +210,7 @@ "app settings": "एप्लिकेशन सेटिंग", "disable in-app-browser caching": "इन-ऐप-ब्राउज़र कैशिंग बंद करें", "copied to clipboard": "क्लिपबोर्ड पर कॉपी किया गया", + "clipboard not available": "Clipboard is not available.", "remember opened files": "खोली गई फ़ाइलें याद रखें", "remember opened folders": "खोले गए फोल्डर याद रखें", "no suggestions": "कोई सुझाव नहीं", diff --git a/src/lang/hu-hu.json b/src/lang/hu-hu.json index 7613823d7..2e846ec29 100644 --- a/src/lang/hu-hu.json +++ b/src/lang/hu-hu.json @@ -209,6 +209,7 @@ "app settings": "Alkalmazás-beállítások", "disable in-app-browser caching": "Az alkalmazáson belüli böngésző gyorsítótárazásának letiltása", "copied to clipboard": "Vágólapra másolva", + "clipboard not available": "Clipboard is not available.", "remember opened files": "Megnyitott fájlok megjegyzése", "remember opened folders": "Megnyitott mappák megjegyzése", "no suggestions": "Javaslatok nélkül", diff --git a/src/lang/id-id.json b/src/lang/id-id.json index d20ab446e..900e5c275 100644 --- a/src/lang/id-id.json +++ b/src/lang/id-id.json @@ -210,6 +210,7 @@ "disable in-app-browser caching": "Nonaktifkan caching peramban-dalam-aplikasi", "Should use Current File For preview instead of default (index.html)": "Harus menggunakan berkas saat ini untuk pratinjau alih-alih default (index.html)", "copied to clipboard": "Disalin ke clipboard", + "clipboard not available": "Clipboard is not available.", "remember opened files": "Ingat berkas yang dibuka", "remember opened folders": "Ingat folder yang dibuka", "no suggestions": "Tidak ada saran", diff --git a/src/lang/ir-fa.json b/src/lang/ir-fa.json index 50d85ef67..9ef4c35a3 100644 --- a/src/lang/ir-fa.json +++ b/src/lang/ir-fa.json @@ -210,6 +210,7 @@ "app settings": "App settings", "disable in-app-browser caching": "Disable in-app-browser caching", "copied to clipboard": "Copied to clipboard", + "clipboard not available": "Clipboard is not available.", "remember opened files": "Remember opened files", "remember opened folders": "Remember opened folders", "no suggestions": "No suggestions", diff --git a/src/lang/it-it.json b/src/lang/it-it.json index 114125dc0..187c22bab 100644 --- a/src/lang/it-it.json +++ b/src/lang/it-it.json @@ -209,6 +209,7 @@ "app settings": "App settings", "disable in-app-browser caching": "Disable in-app-browser caching", "copied to clipboard": "Copied to clipboard", + "clipboard not available": "Clipboard is not available.", "remember opened files": "Remember opened files", "remember opened folders": "Remember opened folders", "no suggestions": "No suggestions", diff --git a/src/lang/ja-jp.json b/src/lang/ja-jp.json index 9dc2d5ec1..b3087e455 100644 --- a/src/lang/ja-jp.json +++ b/src/lang/ja-jp.json @@ -209,6 +209,7 @@ "app settings": "アプリ設定", "disable in-app-browser caching": "アプリ内ブラウザのキャッシュを無効", "copied to clipboard": "クリップボードにコピーしました", + "clipboard not available": "Clipboard is not available.", "remember opened files": "開いたファイルを記憶する", "remember opened folders": "開いたフォルダを記憶する", "no suggestions": "候補を表示しない", diff --git a/src/lang/ko-kr.json b/src/lang/ko-kr.json index 848b645e1..29411e722 100644 --- a/src/lang/ko-kr.json +++ b/src/lang/ko-kr.json @@ -209,6 +209,7 @@ "app settings": "App settings", "disable in-app-browser caching": "Disable in-app-browser caching", "copied to clipboard": "Copied to clipboard", + "clipboard not available": "Clipboard is not available.", "remember opened files": "Remember opened files", "remember opened folders": "Remember opened folders", "no suggestions": "No suggestions", diff --git a/src/lang/ml-in.json b/src/lang/ml-in.json index fd7d4dfe7..9e3e46bd7 100644 --- a/src/lang/ml-in.json +++ b/src/lang/ml-in.json @@ -209,6 +209,7 @@ "app settings": "ആപ്പ് സെറ്റിംഗ്സ്", "disable in-app-browser caching": "ഇൻ-ആപ്പ്-ബ്രൗസർ കാഷിംഗ് പ്രവർത്തനരഹിതമാക്കുക", "copied to clipboard": "ക്ലിപ്പ് ബോർഡിൽ കോപ്പി ചെയ്തു ", + "clipboard not available": "Clipboard is not available.", "remember opened files": "ഓപ്പൺഡ് ഫയൽസ് റിമെംബേർ ചെയുക", "remember opened folders": "ഓപ്പൺഡ് ഫോൾഡർ റിമെംബേർ ചെയുക", "no suggestions": "നോ സഗ്ഗെസ്ഷൻ ", diff --git a/src/lang/mm-unicode.json b/src/lang/mm-unicode.json index b0f5b21ea..e8853a9d1 100644 --- a/src/lang/mm-unicode.json +++ b/src/lang/mm-unicode.json @@ -209,6 +209,7 @@ "app settings": "App settings", "disable in-app-browser caching": "Disable in-app-browser caching", "copied to clipboard": "Copied to clipboard", + "clipboard not available": "Clipboard is not available.", "remember opened files": "Remember opened files", "remember opened folders": "Remember opened folders", "no suggestions": "No suggestions", diff --git a/src/lang/mm-zawgyi.json b/src/lang/mm-zawgyi.json index e6bb03fb0..c882150d6 100644 --- a/src/lang/mm-zawgyi.json +++ b/src/lang/mm-zawgyi.json @@ -209,6 +209,7 @@ "app settings": "App settings", "disable in-app-browser caching": "Disable in-app-browser caching", "copied to clipboard": "Copied to clipboard", + "clipboard not available": "Clipboard is not available.", "remember opened files": "Remember opened files", "remember opened folders": "Remember opened folders", "no suggestions": "No suggestions", diff --git a/src/lang/pl-pl.json b/src/lang/pl-pl.json index 847f07f1b..7202d4142 100644 --- a/src/lang/pl-pl.json +++ b/src/lang/pl-pl.json @@ -209,6 +209,7 @@ "app settings": "Ustawienia aplikacji", "disable in-app-browser caching": "Wyłącz cache w wbudowanej przeglądarce", "copied to clipboard": "Skopiowano do schowka", + "clipboard not available": "Clipboard is not available.", "remember opened files": "Zapamiętaj otwarte pliki", "remember opened folders": "Zapamiętaj otwarte foldery", "no suggestions": "Bez sugestii", diff --git a/src/lang/pt-br.json b/src/lang/pt-br.json index eae43272a..9249ed254 100644 --- a/src/lang/pt-br.json +++ b/src/lang/pt-br.json @@ -209,6 +209,7 @@ "app settings": "Configurações do aplicativo", "disable in-app-browser caching": "Desativar o cache do navegador no aplicativo", "copied to clipboard": "Copiado para a área de transferência", + "clipboard not available": "Clipboard is not available.", "remember opened files": "Manter arquivos abertos", "remember opened folders": "Manter pastas abertas", "no suggestions": "Nenhuma sugestão", diff --git a/src/lang/pu-in.json b/src/lang/pu-in.json index 506523cf6..cf6b2302a 100644 --- a/src/lang/pu-in.json +++ b/src/lang/pu-in.json @@ -209,6 +209,7 @@ "app settings": "ਐਪ ਸੈਟਿੰਗਾਂ", "disable in-app-browser caching": "ਇਨ-ਐਪ-ਬ੍ਰਾਊਜ਼ਰ ਕੈਚਿੰਗ ਨੂੰ ਅਸਮਰੱਥ ਬਣਾਓ", "copied to clipboard": "ਕਲਿੱਪਬੋਰਡ 'ਤੇ ਕਾਪੀ ਕੀਤਾ ਗਿਆ", + "clipboard not available": "Clipboard is not available.", "remember opened files": "ਖੋਲ੍ਹੀਆਂ ਫਾਈਲਾਂ ਨੂੰ ਯਾਦ ਰੱਖੋ", "remember opened folders": "ਖੋਲ੍ਹੇ ਫੋਲਡਰਾਂ ਨੂੰ ਯਾਦ ਰੱਖੋ", "no suggestions": "ਕੋਈ ਸੁਝਾਅ ਨਹੀਂ", diff --git a/src/lang/ru-ru.json b/src/lang/ru-ru.json index 3eb467537..e3a7e7949 100644 --- a/src/lang/ru-ru.json +++ b/src/lang/ru-ru.json @@ -209,6 +209,7 @@ "app settings": "Настройки приложения", "disable in-app-browser caching": "Отключить кэширование во встроенном браузере", "copied to clipboard": "Скопировано в буфер обмена", + "clipboard not available": "Clipboard is not available.", "remember opened files": "Запоминать открытые файлы", "remember opened folders": "Запоминать открытые папки", "no suggestions": "Откл. подсказок", diff --git a/src/lang/tl-ph.json b/src/lang/tl-ph.json index bc33bf689..dae41a4a3 100644 --- a/src/lang/tl-ph.json +++ b/src/lang/tl-ph.json @@ -209,6 +209,7 @@ "app settings": "Mga settings sa app", "disable in-app-browser caching": "I-disable ang in-app-browser caching", "copied to clipboard": "Kinopya sa clipboard", + "clipboard not available": "Clipboard is not available.", "remember opened files": "Tandaan ang mga nabuksan na file", "remember opened folders": "Tandaan ang mga nabuksan na folder", "no suggestions": "Walang suggestions", diff --git a/src/lang/tr-tr.json b/src/lang/tr-tr.json index 161260ac2..4ae8fc3cb 100644 --- a/src/lang/tr-tr.json +++ b/src/lang/tr-tr.json @@ -209,6 +209,7 @@ "app settings": "App settings", "disable in-app-browser caching": "Disable in-app-browser caching", "copied to clipboard": "Copied to clipboard", + "clipboard not available": "Clipboard is not available.", "remember opened files": "Remember opened files", "remember opened folders": "Remember opened folders", "no suggestions": "No suggestions", diff --git a/src/lang/uk-ua.json b/src/lang/uk-ua.json index ccec9c9bb..153c99d0f 100644 --- a/src/lang/uk-ua.json +++ b/src/lang/uk-ua.json @@ -209,6 +209,7 @@ "app settings": "Налаштування програми", "disable in-app-browser caching": "Вимкнути кешування в оглядачі програми", "copied to clipboard": "Скопійовано до буфера обміну", + "clipboard not available": "Clipboard is not available.", "remember opened files": "Памʼятати відкриті файли", "remember opened folders": "Памʼятати відкриті теки", "no suggestions": "Без пропозицій", diff --git a/src/lang/uz-uz.json b/src/lang/uz-uz.json index a21eac915..0870a6a7d 100644 --- a/src/lang/uz-uz.json +++ b/src/lang/uz-uz.json @@ -209,6 +209,7 @@ "app settings": "App settings", "disable in-app-browser caching": "Disable in-app-browser caching", "copied to clipboard": "Copied to clipboard", + "clipboard not available": "Clipboard is not available.", "remember opened files": "Remember opened files", "remember opened folders": "Remember opened folders", "no suggestions": "No suggestions", diff --git a/src/lang/vi-vn.json b/src/lang/vi-vn.json index 8f61d169e..985e4c6c6 100644 --- a/src/lang/vi-vn.json +++ b/src/lang/vi-vn.json @@ -210,6 +210,7 @@ "disable in-app-browser caching": "Tắt bộ nhớ đệm trong trình duyệt ứng dụng", "Should use Current File For preview instead of default (index.html)": "Nên sử dụng Tệp hiện tại để xem trước thay vì mặc định (index.html)", "copied to clipboard": "Đã sao chép vào bảng nhớ tạm", + "clipboard not available": "Clipboard is not available.", "remember opened files": "Ghi nhớ các tệp đã mở", "remember opened folders": "Ghi nhớ các thư mục đã mở", "no suggestions": "Không có gợi ý", diff --git a/src/lang/zh-cn.json b/src/lang/zh-cn.json index c4beb297d..80114863e 100644 --- a/src/lang/zh-cn.json +++ b/src/lang/zh-cn.json @@ -209,6 +209,7 @@ "app settings": "应用设置", "disable in-app-browser caching": "关闭内置浏览器缓存", "copied to clipboard": "复制到剪贴板", + "clipboard not available": "Clipboard is not available.", "remember opened files": "记住打开过的文件", "remember opened folders": "记住打开过的文件夹", "no suggestions": "不显示建议", diff --git a/src/lang/zh-hant.json b/src/lang/zh-hant.json index b94ace6d9..27b57c2b2 100644 --- a/src/lang/zh-hant.json +++ b/src/lang/zh-hant.json @@ -209,6 +209,7 @@ "app settings": "應用設置", "disable in-app-browser caching": "關閉內置瀏覽器緩存", "copied to clipboard": "復製到剪貼板", + "clipboard not available": "Clipboard is not available.", "remember opened files": "記住打開過的文件", "remember opened folders": "記住打開過的文件夾", "no suggestions": "不顯示建議", diff --git a/src/lang/zh-tw.json b/src/lang/zh-tw.json index 14171dbd5..a7ebc663a 100644 --- a/src/lang/zh-tw.json +++ b/src/lang/zh-tw.json @@ -209,6 +209,7 @@ "app settings": "應用程式設定", "disable in-app-browser caching": "關閉內建瀏覽器快取", "copied to clipboard": "已複製到剪貼簿", + "clipboard not available": "Clipboard is not available.", "remember opened files": "記住開啟過的檔案", "remember opened folders": "記住開啟過的資料夾", "no suggestions": "不顯示建議", diff --git a/src/pages/fileBrowser/fileBrowser.js b/src/pages/fileBrowser/fileBrowser.js index 4943f9bd4..c1becb183 100644 --- a/src/pages/fileBrowser/fileBrowser.js +++ b/src/pages/fileBrowser/fileBrowser.js @@ -835,7 +835,11 @@ function FileBrowserInclude(mode, info, doesOpenLast = true) { } else if (navigator.clipboard?.writeText) { await navigator.clipboard.writeText(url); } else { - alert(strings.error, "Clipboard is not available."); + alert( + strings.error, + strings["clipboard not available"] || + "Clipboard is not available.", + ); break; } alert(strings.success, strings["copied to clipboard"]); diff --git a/www/index.html b/www/index.html index f403955d7..bd3913014 100644 --- a/www/index.html +++ b/www/index.html @@ -91,15 +91,30 @@ return match ? Number(match[1]) : 0; } + var pendingStartupMessage = ""; + var hasPendingStartupMessageListener = false; + + function isStartupLoading() { + return !document.body || document.body.classList.contains("loading"); + } + + function applyStartupMessage() { + hasPendingStartupMessageListener = false; + if (document.body && isStartupLoading()) { + document.body.setAttribute("data-small-msg", pendingStartupMessage); + } + } + function setStartupMessage(message) { - var applyMessage = function () { - document.body.setAttribute("data-small-msg", message); - }; + pendingStartupMessage = message; if (document.body) { - applyMessage(); - } else { - document.addEventListener("DOMContentLoaded", applyMessage); + applyStartupMessage(); + } else if (!hasPendingStartupMessageListener) { + hasPendingStartupMessageListener = true; + document.addEventListener("DOMContentLoaded", applyStartupMessage, { + once: true, + }); } } @@ -115,15 +130,17 @@ ); } - window.addEventListener("error", function (event) { + function handleStartupError(event) { + if (!isStartupLoading()) return; var message = event && event.message ? event.message : "Startup error"; setStartupMessage( "Acode failed to start. Update Android System WebView or Chrome. " + message, ); - }); + } - window.addEventListener("unhandledrejection", function (event) { + function handleStartupRejection(event) { + if (!isStartupLoading()) return; var reason = event && event.reason; var message = reason && reason.message ? reason.message : "Startup promise failed"; @@ -131,7 +148,10 @@ "Acode failed to start. Update Android System WebView or Chrome. " + message, ); - }); + } + + window.addEventListener("error", handleStartupError); + window.addEventListener("unhandledrejection", handleStartupRejection); })(); From ab501ef90a14e83fe01c5629e78f4b5b91e31650 Mon Sep 17 00:00:00 2001 From: Raunak Raj <71929976+bajrangCoder@users.noreply.github.com> Date: Fri, 8 May 2026 10:45:28 +0530 Subject: [PATCH 3/5] add missing string --- src/lang/ar-ye.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lang/ar-ye.json b/src/lang/ar-ye.json index d3f13b411..6e6902254 100644 --- a/src/lang/ar-ye.json +++ b/src/lang/ar-ye.json @@ -500,6 +500,7 @@ "info-developermode": "تمكين أدوات المطور (Eruda) لتصحيح الإضافات ومعاينة حالة التطبيق. سيتم تفعيل المستكشف عند بدء التشغيل.", "developer mode enabled": "تم تفعيل وضع المطور. استخدم لوحة الأوامر لتبديل المستكشف (Ctrl+Shift+I).", "developer mode disabled": "تم تعطيل وضع المطور", + "copy relative path": "Copy Relative Path", "shortcut request sent": "Shortcut request opened. Tap Add to finish.", "add to home screen": "Add to home screen", "pin shortcuts not supported": "Home screen shortcuts are not supported on this device.", From 5d0b603294543a5772621ea9ebd08f2fb185ddea Mon Sep 17 00:00:00 2001 From: Raunak Raj <71929976+bajrangCoder@users.noreply.github.com> Date: Fri, 8 May 2026 10:49:05 +0530 Subject: [PATCH 4/5] sync strings --- src/lang/be-by.json | 1 - src/lang/he-il.json | 1 - src/lang/hi-in.json | 1 - src/lang/id-id.json | 1 - src/lang/ir-fa.json | 1 - src/lang/vi-vn.json | 1 - 6 files changed, 6 deletions(-) diff --git a/src/lang/be-by.json b/src/lang/be-by.json index f0dceb3dd..6863f5685 100644 --- a/src/lang/be-by.json +++ b/src/lang/be-by.json @@ -208,7 +208,6 @@ "normal": "Звычайны", "app settings": "Налады праграмы", "disable in-app-browser caching": "Адключыць кэшаванне ў праграмным сродку агляду", - "Should use Current File For preview instead of default (index.html)": "Для папярэдняга прагляду варта выкарыстоўваць бягучы файл замест прадвызначанага (index.html)", "copied to clipboard": "Скапіявана ў буфер абмену", "clipboard not available": "Clipboard is not available.", "remember opened files": "Запамінаць адкрытыя файлы", diff --git a/src/lang/he-il.json b/src/lang/he-il.json index 23a198b9c..2a3c35903 100644 --- a/src/lang/he-il.json +++ b/src/lang/he-il.json @@ -208,7 +208,6 @@ "normal": "רגיל", "app settings": "הגדרות האפליקציה", "disable in-app-browser caching": "השבתת אחסון במטמון בדפדפן בתוך האפליקציה", - "Should use Current File For preview instead of default (index.html)": "יש להשתמש בקובץ הנוכחי לתצוגה מקדימה במקום ברירת המחדל (index.html)", "copied to clipboard": "הועתק", "clipboard not available": "Clipboard is not available.", "remember opened files": "זכור קבצים שנפתחו", diff --git a/src/lang/hi-in.json b/src/lang/hi-in.json index 84fd90d66..bcaab6eb7 100644 --- a/src/lang/hi-in.json +++ b/src/lang/hi-in.json @@ -63,7 +63,6 @@ "paste": "पेस्ट", "preview mode": "पूर्वावलोकन मोड", "read only file": "यह फाइल सेव नहीं की सकती, किर्प्या इसे 'सेव एज' से सेव करे", - "redo": "रीडू", "replace": "इससे बदलें", "reload": "रिलोड", "rename": "नाम बदलने", diff --git a/src/lang/id-id.json b/src/lang/id-id.json index 900e5c275..3d3236803 100644 --- a/src/lang/id-id.json +++ b/src/lang/id-id.json @@ -208,7 +208,6 @@ "normal": "Normal", "app settings": "Pengaturan Aplikasi", "disable in-app-browser caching": "Nonaktifkan caching peramban-dalam-aplikasi", - "Should use Current File For preview instead of default (index.html)": "Harus menggunakan berkas saat ini untuk pratinjau alih-alih default (index.html)", "copied to clipboard": "Disalin ke clipboard", "clipboard not available": "Clipboard is not available.", "remember opened files": "Ingat berkas yang dibuka", diff --git a/src/lang/ir-fa.json b/src/lang/ir-fa.json index 9ef4c35a3..9aceb3e8d 100644 --- a/src/lang/ir-fa.json +++ b/src/lang/ir-fa.json @@ -65,7 +65,6 @@ "paste": "چسباندن", "preview mode": "حالت پیش نمایش", "read only file": "نمیتوانم فایل های فقط خواندنی(read only) را ویرایش کنم. گزینه (ذخیره به عنوان) را امتحان کنید.", - "redo defination": "پسرو", "reload": "بارگذاری مجدد", "rename": "تغییرنام", "replace": "جایگذاری", diff --git a/src/lang/vi-vn.json b/src/lang/vi-vn.json index 985e4c6c6..1e19279b5 100644 --- a/src/lang/vi-vn.json +++ b/src/lang/vi-vn.json @@ -208,7 +208,6 @@ "normal": "Bình thường", "app settings": "Cài đặt ứng dụng", "disable in-app-browser caching": "Tắt bộ nhớ đệm trong trình duyệt ứng dụng", - "Should use Current File For preview instead of default (index.html)": "Nên sử dụng Tệp hiện tại để xem trước thay vì mặc định (index.html)", "copied to clipboard": "Đã sao chép vào bảng nhớ tạm", "clipboard not available": "Clipboard is not available.", "remember opened files": "Ghi nhớ các tệp đã mở", From 5f3ffb5a4cb0d103554084b51a3ac0b3790d1009 Mon Sep 17 00:00:00 2001 From: Raunak Raj <71929976+bajrangCoder@users.noreply.github.com> Date: Fri, 8 May 2026 10:49:41 +0530 Subject: [PATCH 5/5] improve lang check script to also check for stale strings --- utils/lang.js | 162 ++++++++++++++++++++++---------------------------- 1 file changed, 72 insertions(+), 90 deletions(-) diff --git a/utils/lang.js b/utils/lang.js index d3390e426..7eed1850b 100755 --- a/utils/lang.js +++ b/utils/lang.js @@ -176,106 +176,88 @@ async function update() { let key; if (command === "check") { - let total = 0; - let done = 0; - - fs.readFile(enLang, "utf-8", (err, data) => { - if (err) { - console.error(err); - process.exit(0); - return; - } - - let error = false; + let error = false; + const fix = arg === "fix"; + const enLangData = JSON.parse(fs.readFileSync(enLang, "utf8")); + const enKeys = Object.keys(enLangData); + + for (const file of list) { + if (file === "en-us.json") continue; + + let flagError = false; + const langFile = path.join(dir, file); + const langData = JSON.parse(fs.readFileSync(langFile, "utf8")); + + const langError = () => { + if (!flagError) { + error = true; + flagError = true; + console.log(`-------------- ${file}`); + } + }; + + for (const enKey of enKeys) { + const key = Object.keys(langData).find((k) => { + try { + return new RegExp(`^${escapeRegExp(k)}$`, "i").test(enKey); + } catch (e) { + console.log({ e, k }); + return false; + } + }); - const fix = arg === "fix"; - const enLangData = JSON.parse(data); + if (!key) { + langError(); + if (fix) { + langData[enKey] = enLangData[enKey]; + } - list.forEach((file, i) => { - if (file === "en-us.json") return; + console.log(`Missing: ${enKey} ${fix ? "✔" : ""}`); + } else if (key !== enKey) { + langError(); + console.log(`Fix: "${key} --> ${enKey}" ${fix ? "✔" : ""}`); - let flagError = false; - let langFile = path.join(dir, file); - const exit = (i, len) => { - if (i + 1 === len) { - if (!error) { - console.log("\nGOOD NEWS! No Error Found\n"); - } - process.exit(0); + if (fix) { + const val = langData[key]; + delete langData[key]; + langData[enKey] = val; } - }; + } + } - fs.readFile(langFile, "utf-8", (err, data) => { - if (err) { - console.error(err); - process.exit(1); - return; + for (const key in langData) { + const enKey = enKeys.find((k) => { + try { + return new RegExp(`^${escapeRegExp(k)}$`, "i").test(key); + } catch (e) { + console.log({ e, k }); + return false; } + }); - let langError = () => { - if (!flagError) { - error = true; - flagError = true; - console.log(`-------------- ${file}`); - } - }; - const langData = JSON.parse(data); - flagError = false; - - for (let enKey in enLangData) { - const key = Object.keys(langData).find((k) => { - try { - if (new RegExp(`^${escapeRegExp(k)}$`, "i").test(enKey)) { - return true; - } - return false; - } catch (e) { - console.log({ e, k }); - return false; - } - }); - - if (!key) { - langError(); - if (fix) { - langData[enKey] = enLangData[enKey]; - } - - console.log(`Missing: ${enKey} ${fix ? "✔" : ""}`); - } else if (key !== enKey) { - langError(); - console.log(`Fix: "${key} --> ${enKey}" ${fix ? "✔" : ""}`); - - if (fix) { - const val = langData[key]; - delete langData[key]; - langData[enKey] = val; - } - } + if (!enKey) { + langError(); + if (fix) { + delete langData[key]; } - if (flagError) { - if (fix) { - total += 1; - const langJSONData = JSON.stringify(langData, undefined, 2); - fs.writeFile(langFile, langJSONData, (err) => { - if (err) { - console.error(err); - process.exit(1); - } - done += 1; - exit(done, total); - }); - } - console.log("\n"); - } + console.log(`Stale: ${key} ${fix ? "✔" : ""}`); + } + } - if (!fix) { - exit(i, len); - } - }); - }); - }); + if (flagError) { + if (fix) { + const langJSONData = JSON.stringify(langData, undefined, 2); + fs.writeFileSync(langFile, langJSONData); + } + console.log("\n"); + } + } + + if (!error) { + console.log("\nGOOD NEWS! No Error Found\n"); + } + process.exit(error && !fix ? 1 : 0); return; }