@@ -1450,7 +1450,8 @@ function initScript() {
14501450 } else {
14511451 customFontInput . style . display = 'none' ;
14521452 updateFontFamily ( this . value , null ) ;
1453- location . reload ( ) ;
1453+ if ( ! isKindleMode ( ) ) localStorage . setItem ( 'font_family' , this . value ) ;
1454+ else setCookie ( 'font_family' , this . value ) ;
14541455 }
14551456 } ) ;
14561457
@@ -1459,10 +1460,23 @@ function initScript() {
14591460 var f = custom . value ? "'" + custom . value + "', sans-serif" : "system-ui, -apple-system, sans-serif" ;
14601461 if ( f === "system-ui, -apple-system, sans-serif" ) {
14611462 updateFontFamily ( f , null ) ;
1463+ if ( ! isKindleMode ( ) ) {
1464+ localStorage . setItem ( 'font_family' , f ) ;
1465+ localStorage . removeItem ( 'font_family_input' ) ;
1466+ } else {
1467+ setCookie ( 'font_family' , f ) ;
1468+ setCookie ( 'font_family_input' , '' ) ;
1469+ }
14621470 } else {
14631471 updateFontFamily ( "custom" , f ) ;
1472+ if ( ! isKindleMode ( ) ) {
1473+ localStorage . setItem ( 'font_family' , "custom" ) ;
1474+ localStorage . setItem ( 'font_family_input' , f ) ;
1475+ } else {
1476+ setCookie ( 'font_family' , "custom" ) ;
1477+ setCookie ( 'font_family_input' , f ) ;
1478+ }
14641479 }
1465- location . reload ( ) ;
14661480 } ) ;
14671481
14681482 settingsControlBtn . addEventListener ( 'click' , function ( ) {
0 commit comments