@@ -415,13 +415,15 @@ export default class Editor {
415415 if ( this . editor . getOption ( 'indentWithTabs' ) ) {
416416 Cookies . set ( 'indent_type' , 'tab' , {
417417 expires : 365 ,
418- sameSite : 'Lax'
418+ sameSite : 'Lax' ,
419+ secure : window . location . protocol === 'https:'
419420 } )
420421 type . text ( 'Tab Size:' )
421422 } else {
422423 Cookies . set ( 'indent_type' , 'space' , {
423424 expires : 365 ,
424- sameSite : 'Lax'
425+ sameSite : 'Lax' ,
426+ secure : window . location . protocol === 'https:'
425427 } )
426428 type . text ( 'Spaces:' )
427429 }
@@ -433,12 +435,14 @@ export default class Editor {
433435 if ( this . editor . getOption ( 'indentWithTabs' ) ) {
434436 Cookies . set ( 'tab_size' , unit , {
435437 expires : 365 ,
436- sameSite : 'Lax'
438+ sameSite : 'Lax' ,
439+ secure : window . location . protocol === 'https:'
437440 } )
438441 } else {
439442 Cookies . set ( 'space_units' , unit , {
440443 expires : 365 ,
441- sameSite : 'Lax'
444+ sameSite : 'Lax' ,
445+ secure : window . location . protocol === 'https:'
442446 } )
443447 }
444448 widthLabel . text ( unit )
@@ -507,7 +511,8 @@ export default class Editor {
507511 var keymap = this . editor . getOption ( 'keyMap' )
508512 Cookies . set ( 'keymap' , keymap , {
509513 expires : 365 ,
510- sameSite : 'Lax'
514+ sameSite : 'Lax' ,
515+ secure : window . location . protocol === 'https:'
511516 } )
512517 label . text ( keymap )
513518 this . restoreOverrideEditorKeymap ( )
@@ -543,7 +548,8 @@ export default class Editor {
543548 this . editor . setOption ( 'theme' , theme )
544549 Cookies . set ( 'theme' , theme , {
545550 expires : 365 ,
546- sameSite : 'Lax'
551+ sameSite : 'Lax' ,
552+ secure : window . location . protocol === 'https:'
547553 } )
548554 this . statusIndicators . find ( '.status-theme li' ) . removeClass ( 'active' )
549555 this . statusIndicators . find ( `.status-theme li[value="${ theme } "]` ) . addClass ( 'active' )
@@ -646,7 +652,8 @@ export default class Editor {
646652
647653 Cookies . set ( 'spellcheck' , false , {
648654 expires : 365 ,
649- sameSite : 'Lax'
655+ sameSite : 'Lax' ,
656+ secure : window . location . protocol === 'https:'
650657 } )
651658
652659 self . editor . setOption ( 'mode' , defaultEditorMode )
@@ -655,7 +662,8 @@ export default class Editor {
655662
656663 Cookies . set ( 'spellcheck' , lang , {
657664 expires : 365 ,
658- sameSite : 'Lax'
665+ sameSite : 'Lax' ,
666+ secure : window . location . protocol === 'https:'
659667 } )
660668
661669 self . editor . setOption ( 'mode' , 'spell-checker' )
@@ -677,7 +685,8 @@ export default class Editor {
677685 }
678686 Cookies . set ( 'linter' , true , {
679687 expires : 365 ,
680- sameSite : 'Lax'
688+ sameSite : 'Lax' ,
689+ secure : window . location . protocol === 'https:'
681690 } )
682691 } else {
683692 this . editor . setOption ( 'gutters' , gutters . filter ( g => g !== lintGutter ) )
@@ -727,7 +736,8 @@ export default class Editor {
727736 if ( overrideBrowserKeymap . is ( ':checked' ) ) {
728737 Cookies . set ( 'preferences-override-browser-keymap' , true , {
729738 expires : 365 ,
730- sameSite : 'Lax'
739+ sameSite : 'Lax' ,
740+ secure : window . location . protocol === 'https:'
731741 } )
732742 this . restoreOverrideEditorKeymap ( )
733743 } else {
0 commit comments