@@ -451,13 +451,15 @@ export default class Editor {
451451 if ( this . editor . getOption ( 'indentWithTabs' ) ) {
452452 Cookies . set ( 'indent_type' , 'tab' , {
453453 expires : 365 ,
454- sameSite : 'Lax'
454+ sameSite : 'Lax' ,
455+ secure : window . location . protocol === 'https:'
455456 } )
456457 type . text ( 'Tab Size:' )
457458 } else {
458459 Cookies . set ( 'indent_type' , 'space' , {
459460 expires : 365 ,
460- sameSite : 'Lax'
461+ sameSite : 'Lax' ,
462+ secure : window . location . protocol === 'https:'
461463 } )
462464 type . text ( 'Spaces:' )
463465 }
@@ -469,12 +471,14 @@ export default class Editor {
469471 if ( this . editor . getOption ( 'indentWithTabs' ) ) {
470472 Cookies . set ( 'tab_size' , unit , {
471473 expires : 365 ,
472- sameSite : 'Lax'
474+ sameSite : 'Lax' ,
475+ secure : window . location . protocol === 'https:'
473476 } )
474477 } else {
475478 Cookies . set ( 'space_units' , unit , {
476479 expires : 365 ,
477- sameSite : 'Lax'
480+ sameSite : 'Lax' ,
481+ secure : window . location . protocol === 'https:'
478482 } )
479483 }
480484 widthLabel . text ( unit )
@@ -543,7 +547,8 @@ export default class Editor {
543547 var keymap = this . editor . getOption ( 'keyMap' )
544548 Cookies . set ( 'keymap' , keymap , {
545549 expires : 365 ,
546- sameSite : 'Lax'
550+ sameSite : 'Lax' ,
551+ secure : window . location . protocol === 'https:'
547552 } )
548553 label . text ( keymap )
549554 this . restoreOverrideEditorKeymap ( )
@@ -579,7 +584,8 @@ export default class Editor {
579584 this . editor . setOption ( 'theme' , theme )
580585 Cookies . set ( 'theme' , theme , {
581586 expires : 365 ,
582- sameSite : 'Lax'
587+ sameSite : 'Lax' ,
588+ secure : window . location . protocol === 'https:'
583589 } )
584590 this . statusIndicators . find ( '.status-theme li' ) . removeClass ( 'active' )
585591 this . statusIndicators . find ( `.status-theme li[value="${ theme } "]` ) . addClass ( 'active' )
@@ -682,7 +688,8 @@ export default class Editor {
682688
683689 Cookies . set ( 'spellcheck' , false , {
684690 expires : 365 ,
685- sameSite : 'Lax'
691+ sameSite : 'Lax' ,
692+ secure : window . location . protocol === 'https:'
686693 } )
687694
688695 self . editor . setOption ( 'mode' , defaultEditorMode )
@@ -691,7 +698,8 @@ export default class Editor {
691698
692699 Cookies . set ( 'spellcheck' , lang , {
693700 expires : 365 ,
694- sameSite : 'Lax'
701+ sameSite : 'Lax' ,
702+ secure : window . location . protocol === 'https:'
695703 } )
696704
697705 self . editor . setOption ( 'mode' , 'spell-checker' )
@@ -713,7 +721,8 @@ export default class Editor {
713721 }
714722 Cookies . set ( 'linter' , true , {
715723 expires : 365 ,
716- sameSite : 'Lax'
724+ sameSite : 'Lax' ,
725+ secure : window . location . protocol === 'https:'
717726 } )
718727 } else {
719728 this . editor . setOption ( 'gutters' , gutters . filter ( g => g !== lintGutter ) )
@@ -763,7 +772,8 @@ export default class Editor {
763772 if ( overrideBrowserKeymap . is ( ':checked' ) ) {
764773 Cookies . set ( 'preferences-override-browser-keymap' , true , {
765774 expires : 365 ,
766- sameSite : 'Lax'
775+ sameSite : 'Lax' ,
776+ secure : window . location . protocol === 'https:'
767777 } )
768778 this . restoreOverrideEditorKeymap ( )
769779 } else {
0 commit comments