File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1123,7 +1123,7 @@ function initScript() {
11231123
11241124 // 根据设备类型显示不同的控件
11251125 if ( isMobile ( ) ) {
1126- // 移动端:显示 mobile-controls
1126+ // 移动端:只显示 mobile-controls,不操作 top-controls 和 reading -controls
11271127 const mobileControls = document . querySelector ( '.mobile-controls' ) ;
11281128 if ( mobileControls ) {
11291129 mobileControls . style . display = 'flex' ;
@@ -1201,7 +1201,7 @@ function initScript() {
12011201
12021202 // 根据设备类型显示不同的控件
12031203 if ( isMobile ( ) ) {
1204- // 移动端:显示 mobile-controls
1204+ // 移动端:只显示 mobile-controls,不操作 top-controls 和 reading -controls
12051205 const mobileControls = document . querySelector ( '.mobile-controls' ) ;
12061206 if ( mobileControls ) {
12071207 mobileControls . style . display = 'flex' ;
@@ -1244,8 +1244,8 @@ function initScript() {
12441244
12451245 // 检查是否为移动端(通过 mobile-controls 是否显示)
12461246 function isMobile ( ) {
1247- const mobileControls = document . querySelector ( '.mobile-controls' ) ;
1248- return window . getComputedStyle ( mobileControls ) . display !== 'none' ;
1247+ // 更可靠的移动端检测方法
1248+ return window . innerWidth <= 768 || / A n d r o i d | w e b O S | i P h o n e | i P a d | i P o d | B l a c k B e r r y | I E M o b i l e | O p e r a M i n i / i . test ( navigator . userAgent ) ;
12491249 }
12501250
12511251 // 点击屏幕中间部分切换纯净阅读模式
You can’t perform that action at this time.
0 commit comments