From d53f9b77cd520a6800633bc801a5479b8c8fd752 Mon Sep 17 00:00:00 2001 From: Evan Reichard Date: Mon, 3 Aug 2026 17:53:27 -0400 Subject: [PATCH] feat(runtime): expose canGoBack for firmware chrome Firmware needs to know whether a back control would go anywhere, and the history that answers it belongs to the runtime. --- native/include/lua/runtime.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/native/include/lua/runtime.h b/native/include/lua/runtime.h index b9bafd1..b914495 100644 --- a/native/include/lua/runtime.h +++ b/native/include/lua/runtime.h @@ -70,6 +70,9 @@ class Runtime { void requestLaunch(const std::string& path, const std::string& arg, bool replace); void requestBack(); bool hasPendingNavigation() const { return pending_.kind != Pending::None; } + // Whether sys.back() would return somewhere rather than land on the launcher, which is what + // firmware chrome needs to decide whether to offer a back control. + bool canGoBack() const { return !history_.empty(); } // Loads whatever was requested. False means the app failed to start or history ran out at the // launcher, in which case no app is running. bool applyPendingNavigation();