Leaner userscript: edge tab, card-click continue, test harness #7

Merged
sulthan merged 7 commits from feat/leaner-functionality into main 2026-07-28 16:21:02 +07:00
Showing only changes of commit 8f32062bab - Show all commits
+7 -7
View File
@@ -795,8 +795,8 @@
}
// Dwell timer: don't advance progress the instant a newer chapter opens (guards
// against a misclick on "latest chapter"). Arm a 25s timer instead; the countdown
// ring around the FAB shows it running. The manual "Update to X" button still fires
// against a misclick on "latest chapter"). Arm a 25s timer instead; the tab fills
// bottom-up to show it counting down. The manual "Update to X" button still fires
// immediately. Timer is keyed to the chapter, not the URL, so turning pages within
// the same chapter (Demonic /chapter/N/<page>) keeps it counting rather than resetting.
const DWELL_MS = 25000;
@@ -1419,12 +1419,12 @@
// ============================================================
// Test hook
//
// Node's require() defines `module`; Bromite's native engine, Tampermonkey,
// and Violentmonkey do not, so this is inert everywhere the script actually
// ships. Exposes pure logic only — see userscript/test/logic.test.js, which
// loads this file with document.body undefined so the UI never boots.
// Fires only in Node, where window is undefined. The typeof window check keeps it
// inert on pages whose own scripts define a UMD module shim — under @grant none
// the userscript shares page globals, so we must not clobber the page's exports.
// Exposes pure logic only — see userscript/test/logic.test.js.
// ============================================================
if (typeof module === "object" && module.exports) {
if (typeof window === "undefined" && typeof module === "object" && module.exports) {
module.exports = { stripBuildHash, asura, demonic, anchorsFromHTML, statusOf };
}