Skip to content

Commit 7964efc

Browse files
committed
fix: focus on body after init
1 parent 3060630 commit 7964efc

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

epub_browser/assets/chapter.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1691,8 +1691,11 @@ function initScript() {
16911691
`;
16921692
document.head.appendChild(style);
16931693

1694-
// 聚焦
1695-
content.focus();
1694+
// 页面加载完成后自动聚焦
1695+
window.addEventListener('load', () => {
1696+
document.body.focus(); // 主动让页面body获得焦点
1697+
});
1698+
16961699
};
16971700

16981701
window.initScriptChapter = initScript;

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setup(
88
name="epub-browser", # 在PyPI上显示的项目名称
9-
version="1.7.2", # 初始版本号
9+
version="1.7.3", # 初始版本号
1010
author="dfface", # 作者名
1111
author_email="dfface@sina.com", # 作者邮箱
1212
keywords="epub reader html export browser convert calibre-web calibre kindle web server local",

0 commit comments

Comments
 (0)