HTTPS-Only Mode: registry value HttpsOnlyModeComputerHKLM\Software\Policies\Mozilla\Firefox

Policy ID
HttpsOnlyMode
Scope
Computer Configuration, User Configuration
Supported on
Firefox 127 or later
Source
Mozilla Firefox Policy Templates (version 8.3)
Category
Mozilla › Firefox

Registry

HttpsOnlyMode

REG_SZComputerUser
Enabled value
Depends on the option value
Element
-
Options
ItemStored value
Off by defaultallowed
Off and lockeddisallowed
On by defaultenabled
On and lockedforce_enabled
Apply with .reg · CMD · PowerShell
ComputerMachine-wide setting
.reg
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\Software\Policies\Mozilla\Firefox]

; Options (use only one)
; Off by default
"HttpsOnlyMode"="allowed"
; Off and locked
"HttpsOnlyMode"="disallowed"
; On by default
"HttpsOnlyMode"="enabled"
; On and locked
"HttpsOnlyMode"="force_enabled"
CMD
:: Options (use only one)

:: Off by default
reg add "HKLM\Software\Policies\Mozilla\Firefox" /v "HttpsOnlyMode" /t REG_SZ /d "allowed" /f
:: Off and locked
reg add "HKLM\Software\Policies\Mozilla\Firefox" /v "HttpsOnlyMode" /t REG_SZ /d "disallowed" /f
:: On by default
reg add "HKLM\Software\Policies\Mozilla\Firefox" /v "HttpsOnlyMode" /t REG_SZ /d "enabled" /f
:: On and locked
reg add "HKLM\Software\Policies\Mozilla\Firefox" /v "HttpsOnlyMode" /t REG_SZ /d "force_enabled" /f
PowerShell
# Common: create the key
New-Item -Path 'HKLM:\Software\Policies\Mozilla\Firefox' -Force | Out-Null

# Options (use only one)
# Off by default
New-ItemProperty -Path 'HKLM:\Software\Policies\Mozilla\Firefox' -Name 'HttpsOnlyMode' -PropertyType String -Value 'allowed' -Force | Out-Null
# Off and locked
New-ItemProperty -Path 'HKLM:\Software\Policies\Mozilla\Firefox' -Name 'HttpsOnlyMode' -PropertyType String -Value 'disallowed' -Force | Out-Null
# On by default
New-ItemProperty -Path 'HKLM:\Software\Policies\Mozilla\Firefox' -Name 'HttpsOnlyMode' -PropertyType String -Value 'enabled' -Force | Out-Null
# On and locked
New-ItemProperty -Path 'HKLM:\Software\Policies\Mozilla\Firefox' -Name 'HttpsOnlyMode' -PropertyType String -Value 'force_enabled' -Force | Out-Null
UserPer-account setting
.reg
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Policies\Mozilla\Firefox]

; Options (use only one)
; Off by default
"HttpsOnlyMode"="allowed"
; Off and locked
"HttpsOnlyMode"="disallowed"
; On by default
"HttpsOnlyMode"="enabled"
; On and locked
"HttpsOnlyMode"="force_enabled"
CMD
:: Options (use only one)

:: Off by default
reg add "HKCU\Software\Policies\Mozilla\Firefox" /v "HttpsOnlyMode" /t REG_SZ /d "allowed" /f
:: Off and locked
reg add "HKCU\Software\Policies\Mozilla\Firefox" /v "HttpsOnlyMode" /t REG_SZ /d "disallowed" /f
:: On by default
reg add "HKCU\Software\Policies\Mozilla\Firefox" /v "HttpsOnlyMode" /t REG_SZ /d "enabled" /f
:: On and locked
reg add "HKCU\Software\Policies\Mozilla\Firefox" /v "HttpsOnlyMode" /t REG_SZ /d "force_enabled" /f
PowerShell
# Common: create the key
New-Item -Path 'HKCU:\Software\Policies\Mozilla\Firefox' -Force | Out-Null

# Options (use only one)
# Off by default
New-ItemProperty -Path 'HKCU:\Software\Policies\Mozilla\Firefox' -Name 'HttpsOnlyMode' -PropertyType String -Value 'allowed' -Force | Out-Null
# Off and locked
New-ItemProperty -Path 'HKCU:\Software\Policies\Mozilla\Firefox' -Name 'HttpsOnlyMode' -PropertyType String -Value 'disallowed' -Force | Out-Null
# On by default
New-ItemProperty -Path 'HKCU:\Software\Policies\Mozilla\Firefox' -Name 'HttpsOnlyMode' -PropertyType String -Value 'enabled' -Force | Out-Null
# On and locked
New-ItemProperty -Path 'HKCU:\Software\Policies\Mozilla\Firefox' -Name 'HttpsOnlyMode' -PropertyType String -Value 'force_enabled' -Force | Out-Null