Control use of the Web Serial API 的登錄值 DefaultSerialGuardSetting電腦HKLM\Software\Policies\Mozilla\Firefox
此語言沒有官方文字 (顯示英文原文)
- 原則 ID
- DefaultSerialGuardSetting
- 適用範圍
- 電腦設定、使用者設定
- 支援的作業系統
- Firefox 151 or later
- 來源
- Mozilla Firefox Policy Templates (版本 8.3)
- 類別
- Mozilla › Firefox
登錄
DefaultSerialGuardSetting
REG_DWORD電腦使用者…\Software\Policies\Mozilla\FirefoxHKLM\Software\Policies\Mozilla\Firefox 目前的機碼
HKCU\Software\Policies\Mozilla\Firefox
HKCU\Software\Policies\Mozilla\Firefox
- 啟用時的值
- 取決於選項值
- 元素
- -
| 項目 | 儲存的值 |
|---|---|
| Do not allow any site to request access to serial ports via the Web Serial API | 2 |
| Allow sites to ask the user to grant access to a serial port | 3 |
以 .reg · CMD · PowerShell 套用
電腦整部電腦的設定
.reg
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\Software\Policies\Mozilla\Firefox] ; 選項 (只使用其中一個) ; Do not allow any site to request access to serial ports via the Web Serial API "DefaultSerialGuardSetting"=dword:00000002 ; Allow sites to ask the user to grant access to a serial port "DefaultSerialGuardSetting"=dword:00000003
CMD
:: 選項 (只使用其中一個) :: Do not allow any site to request access to serial ports via the Web Serial API reg add "HKLM\Software\Policies\Mozilla\Firefox" /v "DefaultSerialGuardSetting" /t REG_DWORD /d 2 /f :: Allow sites to ask the user to grant access to a serial port reg add "HKLM\Software\Policies\Mozilla\Firefox" /v "DefaultSerialGuardSetting" /t REG_DWORD /d 3 /f
PowerShell
# 共通: 建立機碼 New-Item -Path 'HKLM:\Software\Policies\Mozilla\Firefox' -Force | Out-Null # 選項 (只使用其中一個) # Do not allow any site to request access to serial ports via the Web Serial API New-ItemProperty -Path 'HKLM:\Software\Policies\Mozilla\Firefox' -Name 'DefaultSerialGuardSetting' -PropertyType DWord -Value 2 -Force | Out-Null # Allow sites to ask the user to grant access to a serial port New-ItemProperty -Path 'HKLM:\Software\Policies\Mozilla\Firefox' -Name 'DefaultSerialGuardSetting' -PropertyType DWord -Value 3 -Force | Out-Null
使用者各帳戶的設定
.reg
Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Policies\Mozilla\Firefox] ; 選項 (只使用其中一個) ; Do not allow any site to request access to serial ports via the Web Serial API "DefaultSerialGuardSetting"=dword:00000002 ; Allow sites to ask the user to grant access to a serial port "DefaultSerialGuardSetting"=dword:00000003
CMD
:: 選項 (只使用其中一個) :: Do not allow any site to request access to serial ports via the Web Serial API reg add "HKCU\Software\Policies\Mozilla\Firefox" /v "DefaultSerialGuardSetting" /t REG_DWORD /d 2 /f :: Allow sites to ask the user to grant access to a serial port reg add "HKCU\Software\Policies\Mozilla\Firefox" /v "DefaultSerialGuardSetting" /t REG_DWORD /d 3 /f
PowerShell
# 共通: 建立機碼 New-Item -Path 'HKCU:\Software\Policies\Mozilla\Firefox' -Force | Out-Null # 選項 (只使用其中一個) # Do not allow any site to request access to serial ports via the Web Serial API New-ItemProperty -Path 'HKCU:\Software\Policies\Mozilla\Firefox' -Name 'DefaultSerialGuardSetting' -PropertyType DWord -Value 2 -Force | Out-Null # Allow sites to ask the user to grant access to a serial port New-ItemProperty -Path 'HKCU:\Software\Policies\Mozilla\Firefox' -Name 'DefaultSerialGuardSetting' -PropertyType DWord -Value 3 -Force | Out-Null