studio
2024.10
false
重要 :
新发布内容的本地化可能需要 1-2 周的时间才能完成。
UiPath logo, featuring letters U and I in white

Studio 用户指南

上次更新日期 2025年6月13日

故障排除

注意:您需使用 Firefox 52.0 版及更高版本,才能执行浏览器自动化。

本主题介绍了 Firefox 扩展程序可能无法正常工作的常见原因,以及针对这些问题的解决方案。

版本低于 v128 或 v115 ESR 的 Firefox 上的扩展程序

According to Mozilla announcement about Firefox's root certificate expiration on March 14, 2025, extensions fail to install in Firefox versions older than v128 or v115.13 ESR.
  • If the extension is already installed in Firefox, it will continue to work even after the root certificate expires.
  • If the extension is installed after the root certificate expires, it will be disabled and will not work.

You can apply certain workarounds, but this depends on how old your Firefox version is and whether or not it is an ESR (Extended Support Release) version.

面向 Firefox ESR 的解决方案

  1. 转到about:config
  2. xpinstall.signatures.required 标志切换为 false

It is preferable to automatically apply this setting to all profiles using one of the methods listed below.

Firefox v102.10 ESR 或更高版本

您可以使用组策略自动修改所有用户和配置文件的 xpinstall.signatures.required 偏好。有关更多详细信息,请参阅“面向 Firefox 的策略模板”。

低于 v102.10 ESR 的 Firefox

更低版本的 Firefox 不支持通过组策略进行 xpinstall.signatures.required。作为替代方案,您可以使用 AutoConfig 文件:
  1. 将以下内容保存到文本文件中:

    // First line must be a comment.
    pref("xpinstall.signatures.required", false);// First line must be a comment.
    pref("xpinstall.signatures.required", false);
  2. 对文本文件 allow-unsigned-extensions.cfg 进行命名。
  3. 将以下内容保存到文本文件中:

    // 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);
  4. 对文本文件 allow-unsigned-extensions.js 进行命名。
  5. 找到 Firefox 安装目录,通常为 C:\Program Files\Mozilla Firefox
  6. allow-unsigned-extensions.cfg 复制到 C:\Program Files\Mozilla Firefox
  7. allow-unsigned-extensions.js 复制到 C:\Program Files\Mozilla Firefox\pref

Firefox - 标准版本

对于非 ESR 版本的 Firefox,您必须使用 AutoConfig 文件。

  1. 将以下内容保存到文本文件中:

    // 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);
    
  2. 对文本文件 enable-legacy.cfg 进行命名。
  3. 将以下内容保存到文本文件中:

    // 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);
  4. 对文本文件 enablelegacy-prefs.js 进行命名。
  5. 找到 Firefox 安装目录,通常为 C:\Program Files\Mozilla Firefox
  6. allow-unsigned-extensions.cfg 复制到 C:\Program Files\Mozilla Firefox
  7. allow-unsigned-extensions.js 复制到 C:\Program Files\Mozilla Firefox\defaults\pref
备注:

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.

离线组策略安装方法不适用于 Firefox 68.0.2 ESR,更低版本可能也不适用。临时解决方法需要将以下内容添加到 PowerShell 脚本中,然后以管理员权限运行:

# 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
}

版本低于 65.0 的 Firefox 上的扩展程序

描述

Mozilla 在 Firefox 中引入了扩展程序签名验证算法,该算法会禁用 Firefox 65.0 版及更低版本的插件。因此,如果您在 65.0 版或更低版本的浏览器上安装适用于 Firefox 的 UiPath 扩展程序,将显示以下错误消息:

This add-on could not be installed because it appears to be corrupt.

解决方案 1

将 Firefox 更新到版本 v66.0.4 或更高版本。

解决方案 2

从 Studio 2020.8 开始,Firefox 扩展程序是新签名的,应该可以在较旧版本的 Firefox 浏览器上正确安装。

Terms of Use and Privacy Notice Popup Window

描述

Starting with Firefox v138, the following prompt is displayed when starting the browser and may affect your automations:

图 1 .. docs image
解决方案

The only solution to skip this prompt is to set the SkipTermsOfUse Group Policy as described here.

检查扩展程序

检查 UiPath Firefox 扩展程序是否已安装并启用:

  1. 在 Mozilla Firefox 中,转到“about:addons”>“扩展程序”。
  2. 如果扩展程序不存在,请按这里的说明来安装。
  3. 确保 UiPath 扩展程序已更新为最新版本。

为防止可能出现的问题:

  1. 在 Mozilla Firefox 中,转到“about:addons”>“扩展程序”。
  2. 打开任务管理器或进程资源管理器。
  3. 检查 ChromeNativeMessaging.exe 进程是否正在运行:
    注意:一个单独的 ChromeNativeMessaging 实例会针对 Chrome 扩展程序运行,所以在执行此检查时需要关闭 Google Chrome。
如果 ChromeNativeMessaging 未在运行:
  1. 在 Mozilla Firefox 中,转到“about:addons”>“扩展程序”。
  2. 通过单击“删除”按钮手动删除 UiPath 扩展程序。
  3. 按照此处的说明,重新安装。

如果上面的信息未能解决您的问题,您可以尝试通过查看追踪,并分析 UiPath 扩展程序抛出的错误,从而获得其他信息。以下是您可以收集和分析的追踪类型:

适用于 Google Chrome 中的一般扩展程序追踪:

转到“打开”菜单 >“网页开发者”>“浏览器控制台”(Ctrl+Shift+J)。将显示“浏览器控制台” 。此处显示扩展程序生成的所有错误。

对于要自动化的网页生成的追踪:

转到“打开”菜单 >“网页开发者”>“网页控制台”(Ctrl+Shift+K)。系统将显示网页控制台。当前网页的所有错误都将显示在此处。

对于完整追踪(不仅限于错误),请执行以下操作:

  1. 打开注册表编辑器。
  2. 导航到 HKEY_CURRENT_USER\SOFTWARE\UiPath 键。
  3. 双击网页扩展程序跟踪 REG_DWORD 值。系统将显示编辑 DWORD 值窗口。
  4. 值数据字段中,将值更改为 1,然后单击“确定”。值即已保存。
    注意:如果 WebExtensionTrace REG_DWORD 值不存在,则必须创建此值,方法是在右侧面板中单击右键,选择“新建”>“DWORD(32 位)值”,然后提供上述值。

检查注册表编辑器中是否缺少某些数据:

  1. 打开注册表编辑器。
  2. 导航到 HKEY_CURRENT_USER\SOFTWARE\Mozilla\NativeMessagingHosts\com.uipath.chromenativemsg 键。
  3. 打开 (Default) REG_SZ 值。系统将显示编辑字符串窗口,且其中应包含类似于 C:\Users\YOUR_USER_NAME\AppData\Local\UiPath\uipath-ff.json 的路径。
  4. 使用文本编辑器(如 Notepad++)在上面找到的路径上打开 .json 文件。
  5. 检查路径属性是否正确指向 ChromeNativeMessaging.exe 的所在位置,类似于 C:\Program Files (x86)\UiPath Studio\UiPath\BrowserExtension\ChromeNativeMessaging.exe

多个浏览器配置文件

从 UiPath 版本 2023.10 开始,适用于 Firefox 的 Uipath 扩展程序支持自动化同时使用多个用户配置文件运行的多个浏览器实例。

注意:自动化多个浏览器配置文件需要 UiPath.UIAutomation.Activities v23.10 或更高版本和使用 UiPathStudio.msi v23.10 或更高版本安装的浏览器扩展程序。

使用“使用应用程序/浏览器”活动时,现在可以使用特定的配置文件打开浏览器。要在浏览器启动时指定配置文件,您必须将参数附加到浏览器命令行中。为此,请使用“统一应用程序目标”输入部分中的“参数”属性。

对于 Firefox,必需参数为:-profile "full_profile_path"。要检索完整的配置文件路径,请导航至 about:profiles 并检索该配置文件的根目录


此页面有帮助吗?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath Logo White
信任与安全
© 2005-2025 UiPath。保留所有权利。