studio
2024.10
false
- 发行说明
- 入门指南
- 设置和配置
- 自动化项目
- 依赖项
- 工作流类型
- 控制流程
- 文件比较
- 自动化最佳实践
- 源代码控件集成
- 调试
- 日志记录
- 诊断工具
- 工作流分析器
- 变量
- 参数
- 导入的命名空间
- 编码自动化
- 基于触发器的 Attended 自动化
- 录制
- 用户界面元素
- 选取器
- 对象存储库
- 数据抓取
- 图像与文本自动化
- Citrix 技术自动化
- RDP 自动化
- VMware Horizon 自动化
- Salesforce 自动化
- SAP 自动化
- macOS 用户界面自动化
- ScreenScrapeJavaSupport 工具
- Webdriver 协议
- 扩展程序
- Studio 测试
- 故障排除
重要 :
新发布内容的本地化可能需要 1-2 周的时间才能完成。

Studio 用户指南
上次更新日期 2025年10月2日
根据 Mozilla 于 2025 年 3 月 14 日发布的关于 Firefox 根证书到期的公告,扩展程序无法在低于 v128 或 v115.13 ESR 的 Firefox 版本中安装。
- 如果扩展程序已经安装于 Firefox 中,即使根证书过期,它也会继续运行。
- 如果扩展程序在根证书过期后安装,它会被禁用,无法运行。
- 转到
about:config
。 - 将
xpinstall.signatures.required
标志切换为false
。
更低版本的 Firefox 不支持通过组策略进行
xpinstall.signatures.required
。作为替代方案,您可以使用 AutoConfig 文件:
- 将以下内容保存到文本文件中:
// First line must be a comment. pref("xpinstall.signatures.required", false);
// First line must be a comment. pref("xpinstall.signatures.required", false); - 对文本文件
allow-unsigned-extensions.cfg
进行命名。 - 将以下内容保存到文本文件中:
// First line must be a comment. pref("general.config.filename", "allow-unsigned-extensions.cfg"); pref("general.config.obscure_value", 0);
// First line must be a comment. pref("general.config.filename", "allow-unsigned-extensions.cfg"); pref("general.config.obscure_value", 0); - 对文本文件
allow-unsigned-extensions.js
进行命名。 - 找到 Firefox 安装目录,通常为
C:\Program Files\Mozilla Firefox
。 - 将
allow-unsigned-extensions.cfg
复制到C:\Program Files\Mozilla Firefox
。 - 将
allow-unsigned-extensions.js
复制到C:\Program Files\Mozilla Firefox\defaults\pref
。
对于非 ESR 版本的 Firefox,您必须使用 AutoConfig 文件。
- 将以下内容保存到文本文件中:
// First line must be a comment. // In Firefox 55+, settings to configure add-on signing (and legacy add-ons) are stored in AddonSettings.jsm // The module exports an object with read-only properties, but that is not an issue since we can just replace // the exported object. // https://searchfox.org/mozilla-central/rev/2e08acdf8862e68b13166970e17809a3b5d6a555/toolkit/mozapps/extensions/internal/AddonSettings.jsm Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); function patchAddonSettings(modulePath) { var Module = Components.utils.import(modulePath, {}); // Note: we read the data from preferences instead of hard-coding a "true", so // that by default legacy add-ons are disabled. This enables the user to only // enable legacy add-ons for specific Firefox profiles when really needed. var AddonSettings; if ("lazy" in Module) { AddonSettings = Object.create(Module.lazy.AddonSettings); } else { AddonSettings = Object.create(Module.AddonSettings); } XPCOMUtils.defineLazyPreferenceGetter(AddonSettings, "REQUIRE_SIGNING", "xpinstall.signatures.required", false); XPCOMUtils.defineLazyPreferenceGetter(AddonSettings, "ALLOW_LEGACY_EXTENSIONS", "extensions.legacy.enabled", true); XPCOMUtils.defineLazyPreferenceGetter(AddonSettings, "LANGPACKS_REQUIRE_SIGNING", "extensions.langpacks.signatures.required", false); if ("lazy" in Module) { Module.lazy.AddonSettings = AddonSettings; } else { Module.AddonSettings = AddonSettings; } } // This is necessary to allow legacy add-ons via preferences. try { patchAddonSettings("resource://gre/modules/addons/XPIProvider.jsm"); } catch (e) { // AddonSettings is not in this file starting with Firefox 61, // but it comes back in Firefox 74 } try { patchAddonSettings("resource://gre/modules/addons/XPIDatabase.jsm"); } catch (e) { // AddonSettings is not in this file until Firefox 61 } // This override is needed to enable unsigned add-ons via preferences. patchAddonSettings("resource://gre/modules/addons/XPIInstall.jsm"); // This override is needed to allow unsigned add-ons to show up without warning in about:addons. // (this is UI-only, the add-on is not actually disabled despite what the UI claims). patchAddonSettings("resource://gre/modules/addons/AddonSettings.jsm"); Components.classes['@mozilla.org/consoleservice;1'] .getService(Components.interfaces.nsIConsoleService) .logStringMessage("enablelegacy.cfg: the extensions.legacy.enabled preference is working again."); pref("xpinstall.signatures.required", false);
// First line must be a comment. // In Firefox 55+, settings to configure add-on signing (and legacy add-ons) are stored in AddonSettings.jsm // The module exports an object with read-only properties, but that is not an issue since we can just replace // the exported object. // https://searchfox.org/mozilla-central/rev/2e08acdf8862e68b13166970e17809a3b5d6a555/toolkit/mozapps/extensions/internal/AddonSettings.jsm Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); function patchAddonSettings(modulePath) { var Module = Components.utils.import(modulePath, {}); // Note: we read the data from preferences instead of hard-coding a "true", so // that by default legacy add-ons are disabled. This enables the user to only // enable legacy add-ons for specific Firefox profiles when really needed. var AddonSettings; if ("lazy" in Module) { AddonSettings = Object.create(Module.lazy.AddonSettings); } else { AddonSettings = Object.create(Module.AddonSettings); } XPCOMUtils.defineLazyPreferenceGetter(AddonSettings, "REQUIRE_SIGNING", "xpinstall.signatures.required", false); XPCOMUtils.defineLazyPreferenceGetter(AddonSettings, "ALLOW_LEGACY_EXTENSIONS", "extensions.legacy.enabled", true); XPCOMUtils.defineLazyPreferenceGetter(AddonSettings, "LANGPACKS_REQUIRE_SIGNING", "extensions.langpacks.signatures.required", false); if ("lazy" in Module) { Module.lazy.AddonSettings = AddonSettings; } else { Module.AddonSettings = AddonSettings; } } // This is necessary to allow legacy add-ons via preferences. try { patchAddonSettings("resource://gre/modules/addons/XPIProvider.jsm"); } catch (e) { // AddonSettings is not in this file starting with Firefox 61, // but it comes back in Firefox 74 } try { patchAddonSettings("resource://gre/modules/addons/XPIDatabase.jsm"); } catch (e) { // AddonSettings is not in this file until Firefox 61 } // This override is needed to enable unsigned add-ons via preferences. patchAddonSettings("resource://gre/modules/addons/XPIInstall.jsm"); // This override is needed to allow unsigned add-ons to show up without warning in about:addons. // (this is UI-only, the add-on is not actually disabled despite what the UI claims). patchAddonSettings("resource://gre/modules/addons/AddonSettings.jsm"); Components.classes['@mozilla.org/consoleservice;1'] .getService(Components.interfaces.nsIConsoleService) .logStringMessage("enablelegacy.cfg: the extensions.legacy.enabled preference is working again."); pref("xpinstall.signatures.required", false); - 对文本文件
enablelegacy.cfg
进行命名。 - 将以下内容保存到文本文件中:
// First line must be a comment. pref("general.config.filename", "enablelegacy.cfg"); pref("general.config.obscure_value", 0); pref("general.config.sandbox_enabled", false);
// First line must be a comment. pref("general.config.filename", "enablelegacy.cfg"); pref("general.config.obscure_value", 0); pref("general.config.sandbox_enabled", false); - 对文本文件
enablelegacy-prefs.js
进行命名。 - 找到 Firefox 安装目录,通常为
C:\Program Files\Mozilla Firefox
。 - 将
enablelegacy.cfg
复制到C:\Program Files\Mozilla Firefox
。 - 将
enablelegacy-prefs.js
复制到C:\Program Files\Mozilla Firefox\defaults\pref
。
Note: Recent versions of Firefox, like 102.10 ESR, re-enable the extension automatically once the flag is set. In older versions such as 68.0.2 ESR, it may be necessary to reinstall the extension.
Note: Firefox older than 68.0.2 ESR does not work with our implementation of Group Policy installation. The following script is a fix to be executed after running our installers. Studio 25.10 or newer will fix the
incompatibility.
# Define the registry path
$regPath = "HKLM:\SOFTWARE\Policies\Mozilla\Firefox\Extensions\Install"
function Convert-WindowsPathToFileUrl($path) {
$unixPath = $path -replace '\\', '/'
$escapedPath = $unixPath -replace ' ', '%20'
return "file:///" + $escapedPath
}
function Fix-FirefoxProfile($prefsPath, $fileUrl) {
if (-not (Test-Path $prefsPath)) {
Write-Host "prefs.js not found: $prefsPath"
return
}
Write-Host "Processing prefs.js: $prefsPath"
$content = Get-Content -Path $prefsPath -Raw
$pattern = 'user_pref\("browser\.policies\.runOncePerModification\.extensionsInstall",\s*"(.+?)"\);'
if (-not ($content -match $pattern)) {
Write-Host " -> No matching preference found in prefs.js."
return
}
$jsonArrayString = $matches[1]
# Unescape \" to "
$jsonArrayStringUnescaped = $jsonArrayString -replace '\\\"', '"'
try {
$list = ConvertFrom-Json -InputObject $jsonArrayStringUnescaped
} catch {
Write-Host " -> Error parsing JSON inside prefs.js preference (after unescaping)."
return
}
if (-not ($list -contains $fileUrl)) {
Write-Host " -> File URL not present in extensionsInstall list."
return
}
$newList = $list | Where-Object { $_ -ne $fileUrl }
$newJsonArrayString = ($newList | ConvertTo-Json -Compress)
# prefs.js expects it wrapped as a string, escaping " as \"
$escapedNewJsonArrayString = $newJsonArrayString -replace '"', '\"'
$newPrefLine = "user_pref(""browser.policies.runOncePerModification.extensionsInstall"", `"$escapedNewJsonArrayString`");"
# Replace the old line
$oldPrefLine = $matches[0]
$content = $content -replace [regex]::Escape($oldPrefLine), $newPrefLine
Set-Content -Path $prefsPath -Value $content -Encoding UTF8
Write-Host " -> prefs.js updated."
}
function Fix-AllFirefoxProfiles($fileUrl) {
$profilesPath = "$env:APPDATA\Mozilla\Firefox\Profiles"
if (-not (Test-Path $profilesPath)) {
Write-Host "Firefox profiles directory not found: $profilesPath"
return
}
$profiles = Get-ChildItem -Path $profilesPath -Directory
foreach ($profile in $profiles) {
$prefsPath = Join-Path $profile.FullName "prefs.js"
Fix-FirefoxProfile -prefsPath $prefsPath -fileUrl $fileUrl
}
}
if (-not (Test-Path $regPath)) {
Write-Host "Registry path not found: $regPath"
return
}
$values = Get-ItemProperty -Path $regPath
foreach ($property in $values.PSObject.Properties) {
$name = $property.Name
$value = $property.Value
if ($value -notmatch "^[a-zA-Z]:\\.*\\uipath-ff\.xpi$") {
continue
}
Write-Host "Found Windows path for uipath-ff.xpi in entry '$name': $value"
$fileUrl = Convert-WindowsPathToFileUrl $value
Write-Host " -> Converted to file URL: $fileUrl"
Set-ItemProperty -Path $regPath -Name $name -Value $fileUrl
Write-Host " -> Updated registry key '$name'."
Fix-AllFirefoxProfiles -fileUrl $fileUrl
}
# Define the registry path
$regPath = "HKLM:\SOFTWARE\Policies\Mozilla\Firefox\Extensions\Install"
function Convert-WindowsPathToFileUrl($path) {
$unixPath = $path -replace '\\', '/'
$escapedPath = $unixPath -replace ' ', '%20'
return "file:///" + $escapedPath
}
function Fix-FirefoxProfile($prefsPath, $fileUrl) {
if (-not (Test-Path $prefsPath)) {
Write-Host "prefs.js not found: $prefsPath"
return
}
Write-Host "Processing prefs.js: $prefsPath"
$content = Get-Content -Path $prefsPath -Raw
$pattern = 'user_pref\("browser\.policies\.runOncePerModification\.extensionsInstall",\s*"(.+?)"\);'
if (-not ($content -match $pattern)) {
Write-Host " -> No matching preference found in prefs.js."
return
}
$jsonArrayString = $matches[1]
# Unescape \" to "
$jsonArrayStringUnescaped = $jsonArrayString -replace '\\\"', '"'
try {
$list = ConvertFrom-Json -InputObject $jsonArrayStringUnescaped
} catch {
Write-Host " -> Error parsing JSON inside prefs.js preference (after unescaping)."
return
}
if (-not ($list -contains $fileUrl)) {
Write-Host " -> File URL not present in extensionsInstall list."
return
}
$newList = $list | Where-Object { $_ -ne $fileUrl }
$newJsonArrayString = ($newList | ConvertTo-Json -Compress)
# prefs.js expects it wrapped as a string, escaping " as \"
$escapedNewJsonArrayString = $newJsonArrayString -replace '"', '\"'
$newPrefLine = "user_pref(""browser.policies.runOncePerModification.extensionsInstall"", `"$escapedNewJsonArrayString`");"
# Replace the old line
$oldPrefLine = $matches[0]
$content = $content -replace [regex]::Escape($oldPrefLine), $newPrefLine
Set-Content -Path $prefsPath -Value $content -Encoding UTF8
Write-Host " -> prefs.js updated."
}
function Fix-AllFirefoxProfiles($fileUrl) {
$profilesPath = "$env:APPDATA\Mozilla\Firefox\Profiles"
if (-not (Test-Path $profilesPath)) {
Write-Host "Firefox profiles directory not found: $profilesPath"
return
}
$profiles = Get-ChildItem -Path $profilesPath -Directory
foreach ($profile in $profiles) {
$prefsPath = Join-Path $profile.FullName "prefs.js"
Fix-FirefoxProfile -prefsPath $prefsPath -fileUrl $fileUrl
}
}
if (-not (Test-Path $regPath)) {
Write-Host "Registry path not found: $regPath"
return
}
$values = Get-ItemProperty -Path $regPath
foreach ($property in $values.PSObject.Properties) {
$name = $property.Name
$value = $property.Value
if ($value -notmatch "^[a-zA-Z]:\\.*\\uipath-ff\.xpi$") {
continue
}
Write-Host "Found Windows path for uipath-ff.xpi in entry '$name': $value"
$fileUrl = Convert-WindowsPathToFileUrl $value
Write-Host " -> Converted to file URL: $fileUrl"
Set-ItemProperty -Path $regPath -Name $name -Value $fileUrl
Write-Host " -> Updated registry key '$name'."
Fix-AllFirefoxProfiles -fileUrl $fileUrl
}