标签栏:刷新后至少保留当前页,避免空着

This commit is contained in:
renshen 2026-10-13 15:26:40 +08:00
parent a8a0c6d4c9
commit 1c00548396

View File

@ -128,7 +128,9 @@
existing.title = pageTitle();
existing.url = currentUrl;
save(items);
} else if (openedFromApp) {
} else if (openedFromApp || items.length === 0) {
// 从系统内点进来的页面,或者当前会话还没有任何标签(例如刷新后),
// 把当前页作为第一个标签,避免标签栏空着。
items.push({ path: currentPath, url: currentUrl, title: pageTitle() });
items = items.slice(-maxTabs);
save(items);