Repository navigation
KsuWebUI-SN 1.2-53
·
21 commits
to main
since this release
Tip
Highlights: this release adds a new Export tab to the module's Eruda console. Pick what you want (local storage, session storage, cookies, IndexedDB, Cache Storage, executions, network requests and console logs) and save it all as one ZIP file. Pressing back on a module's WebUI now asks before it closes, so you can't leave by accident. All Eruda console texts are now English only.
✨ New
- Export tab: open the module's Eruda console and use the new Export tab (placed right after Executions). It shows a short description and an Export button.
- Choose what to export: tapping Export opens a checklist with nothing ticked, so you decide what leaves the device. The items are Local storage, Session storage, Cookies, IndexedDB, Cache storage, Executions, Network requests and Console logs. There is also a Select all row.
- Items with no data: they are listed last, dimmed and marked Not found, and can't be selected.
- One ZIP, one file per item: every ticked item is saved as its own file inside a single ZIP named
KsuWebUI-SN_export-<date>_<time>.zip. Aninfo.jsonfile in the ZIP lists the exported items, the time, the page address and any item that failed. - Readable storage files: local storage and session storage are written in an easy to read layout and split into Eruda settings and module data. Values that are JSON are shown as JSON instead of one long escaped line.
- Network requests: you get a
network.jsonlist of all requests plus the response body of each request as its own file in anetworkfolder. - Exit confirmation: pressing back in a module's WebUI still goes back through the pages first. When there is no page left to go back to, a dialog asks Exit this module WebUI? with Yes and No. The new text is translated in Arabic, French, Polish, Japanese and Simplified Chinese with DeepL.
🔁 Changed
- Executions export moved: the Export button is gone from the Executions tab. Executions are now exported from the new Export tab together with everything else.
- Eruda console texts are English only: all texts in the Eruda console and its dialogs and messages (Add, Edit, Key, Value, the clear and restore items, Live reload, Copy response body, Open Editor, the reload dialog, and the Copied, Refreshed, Styles updated and Page reloaded messages) are now always shown in English, whatever the app language is. The Enable console debug and Disable console debug menu items are not part of the Eruda console and stay translated.
- Better buttons: the buttons in the Executions tab are bigger and easier to see and tap, and the Open Editor button in the Editor tab is now a filled button. Both tabs also look correct when an Eruda console theme doesn't provide its colors.
- Module cards: tapping the bottom row of a module card no longer opens its WebUI. This covers the empty space around the settings icon, the size and date chips and the switch, the card edges and the space below them, so a missed tap can't open the module by accident. The rest of the card still opens the WebUI as before.
🧹 Removed
- Eruda console translations: the Arabic, French, Polish, Japanese and Simplified Chinese translations of 27 Eruda console texts were deleted. The English text of these 27 Eruda console texts is now built into the app instead of being stored in the English strings file.
⚙️ Under the hood
For developers ⚠️ (Click to expand)
Export tab (new)
assets/eruda/export.js(new): injected witherudaJs("export")afterexecutionsand beforeeditorin the Eruda console setup. It registers anExporttool in Eruda and moves its tab afterExecutions(beforeelementsif that tab is missing), then callsupdateSlider(). All of it is wrapped intry/catchand skipped if it was already added. Cost: it is only loaded together with the console (Eruda), so modules with the console off are not affected.- Picker: pressing Export checks every item in parallel (
hasfunctions, a failed check counts as not found), unticks everything, puts found items first and disables the rest. Select all only affects found items. If nothing is ticked, an alert asks to select at least one item. - Collectors:
- Local and session storage: keys starting with
eruda-,eruda_,ksu-orksu_go toeruda, all others tomodule, sorted by key. Values that look like JSON are parsed and plain quoted strings are unquoted. - Cookies: read from
document.cookie(cookies that are visible to JavaScript) and URL-decoded when possible. - IndexedDB: uses
indexedDB.databases(). For each database it writes the version and every store withkeyPath,autoIncrement, indexes and all rows. Dates, Maps, Sets, typed arrays, ArrayBuffers and Blobs/Files are encoded with a__typemarker (binary as base64). It stops at depth 30 and marks circular references. - Cache storage: lists every cache with the URL, method, status, content type and length of each entry (the bodies are not exported).
- Executions: the log text from
window.__ksuExecText(). - Network requests: read from
eruda.get('network').requests(). Bodies are saved asnetwork/NNN-<name>.<ext>, with the name cleaned and cut to 60 characters and the extension taken from the response sub type. JSON bodies are pretty printed. - Console logs: read from the rendered log items of the Eruda console, each line starting with its type such as
[error]or[warn], and stack lines indented.
- Local and session storage: keys starting with
- Failures: an item that throws doesn't stop the export. It is written as
<file>.error.txtand listed underfailedininfo.json. - ZIP writer: built in the page with no library. Names are UTF-8 (flag
0x0800), every file has a CRC-32, and files over 64 bytes are compressed withCompressionStream('deflate-raw')when it exists and the result is smaller, otherwise they are stored. No ZIP64, so it is meant for normal sized exports. - Saving: the ZIP is turned into base64 and passed to
ksu_download.save(base64, name, 'application/zip'), the same bridge the old Executions export used.
Executions
assets/eruda/executions.js:exportLog()and its Export button were removed. The text is now built bybuildLogText()and exposed aswindow.__ksuExecText(), which polls first and returns an empty string when there are no entries.- Styles: colors use fallbacks (
var(--foreground, inherit),var(--accent, #4a8cff),var(--console-error-foreground, #f44336)) and neutralrgba(128,128,128,…)backgrounds and borders instead of--border,--backgroundand--darker-background..kx-btngot more padding, a larger radius, a stronger background and an:activestate.
Eruda console texts
WebViewHelper.kt: newERUDA_TEXT_JSconstant (a plain Englishwindow.ksuText = {…}object, now with the 19 export texts added to the existing keys), used in place ofContext.erudaTextJs(), which was removed together with the unusedorg.json.JSONObjectimport. The native Eruda console dialogs now use English literals (Copy,View,Edit,Key,Value) and so do the toasts (Copied,Refreshed,Styles updated,Page reloaded).res/layout/dialog_reload.xml:Reload,Reload tableandReload WebUIare now literal texts instead of string resources.assets/eruda/editor.js: the Open Editor button is a filled accent button and its colors have fallbacks.- Strings: the Eruda console strings were removed from every
strings.xml:reload_title,reload_table,reload_webui,copy_title,view_title,edit_title,choose_key,choose_value,copied,refreshed,eruda_add,eruda_value_for,eruda_exists,eruda_exists_hint,eruda_delete_item,eruda_clear_local,eruda_clear_session,eruda_clear_console,eruda_clear_network,eruda_restore_defaults,eruda_bg_scroll,eruda_live_reload,eruda_copy_body,eruda_open_editor,eruda_editor_hint,live_reload_stylesandlive_reload_reloaded. The two stringsconsole_enableandconsole_disableare unchanged in all languages.
Exit confirmation
WebUIActivity.kt: the back callback is now the fieldbackCallback. It callsgoBack()while the WebView has history, otherwiseconfirmExit().confirmExit()does nothing if the dialog is already showing. It inflatesDialogConfirmBindingwith the new title, hides the message, and usesThemeOverlay_KsuWebUI_ButtonDialog. No dismisses the dialog. Yes dismisses it, setsbackCallback.isEnabled = falseand callsonBackPressedDispatcher.onBackPressed(). The dialog is dismissed inonDestroy.- Strings: new
confirm_exit_webuiin English, Arabic, French, Polish, Japanese and Simplified Chinese. There are noTODO translatemarkers.
Module cards
res/layout/item_module.xml: the bottom row (settings button, chips and switch) got the idactions_row. It now reaches the edges of the card withlayout_marginStartandlayout_marginEndof-20dpand carries its own padding:20dpat the start and end,8dpat the top (this replaces its oldlayout_marginTop) and16dpat the bottom. The same16dpbottom padding was removed from the parent container, which gotclipToPadding="false", so the card looks exactly the same as before.MainActivity.kt:ViewHoldersets the existingconsumeTouchlistener (the one the chips already use) onbinding.actionsRow. Touches that no child handles are consumed by the row, so they never reach the card's click listener that opens the WebUI. The settings button and the switch still handle their own taps first.