Browser Extension Does Not Work In PiP Window

Resolution when browser extension does not work in PiP window.

Issue Description: Browser extension does not work in PiP window.

Root Cause: PiP windows are a special feature of windows that allows a user to have two Windows session at once. This can be helpful in a few different scenarios, especially when it comes to running Attended Automations.

However, this is a new feature and some applications may require special considerations. For example, with most browsers, they do not allow multiple windows sessions to use the same user profile. As such, when launching a PIP Attended automation that users a browser, the user must make a decision:

  1. Disallow the user from using the browser used by the Automation.
  2. Launch the browser using a different user profile (but loose the settings configured for that user profile).

Diagnosing / Resolving

  1. The first step in diagnosing any of these issues to first Run the automation in none PiP mode. If the same error occurs when ran on the users desktop, the issue is not related to PiP.
  2. If the issues is that when the browser tries to launch the Robot it says "Open Browser: The browser already runs in the main session. Please stop the browser or set another user data directory and restart the automation in PIP", that means exactly what it says. When using Firefox, there will not be an error but in the PiP window there will be a message that Firefox is already opened. These are the options:
    1. The user needs to close the browser session in the Main window,
    2. The automation needs to be launched using a different profile. This can be done by setting the UserDataFolderMode to Automatic. See: UI Automation - How To Execute Chrome / Edge / Firefox Automation In PiP Without Interrupting Your Work In The Main Session?
  3. If the option BrowserUserDataFolderMode is set to Default and the issue only happens in PiP mode and it is not the issue described above, then open a ticket with UiPath. Include the following:
    1. The version of the activities being used or a test automation.
    2. Execution logs from when it works and when it does not.
  4. If the option BrowserUserDataFolderMode is set to Automatic or Custom, then it is highly recommend that the extension is installed via group policy. The extension installer can "trick" a computer into thinking there is a group policy for the the given browser by updating a registry key. However, if an actual group policy is defined in your domain for the given browser, these settings will be overwritten and will forcibly remove our extension. The proper way to install the extension by group policy is as follows:
    1. Contact your windows Admin and explain that for the Attended Robot users, the extensions for UiPath are recommended to be installed by group policy. Explain that this is primarily for simplifying configuration and ensuring the PiP browser feature works. The technical requirement comes from how the browser manages profiles.
      1. See: Picture In Picture - Known Issues And Limitations
      2. See: UI Automation - How To Execute Chrome / Edge / Firefox Automation In PiP Without Interrupting Your Work In The Main Session?
    2. Share the following documentation with them based on the browser being used:
      1. Chrome: Chrome Group Policies
      2. Edge: Edge Group Policies
      3. Firefox: Extension For Firefox - Install From Group Policy Offline
        1. Also see: Customizing Firefox Using Group Policy Windows
        2. The Firefox documentation is being updated. Make sure to check the latest documentation but in the meantime know that for the value of the Install parameter your admin can use the path: C:\Program Files\UiPath\Studio\UiPath\BrowserExtension\uipath-ff.pxi
    3. Our installer cannot update the actual group policies because that would require us to access your domain controller.
  5. To check if a group policy is already defined and will overwrite the UiPath policies, do the following:
    1. Check the current policies that are applied to the browser by going to the following URLs:
      1. Chrome: chrome://policy
      2. Edge: edge://policy
      3. Firefox: about:policy
    2. If when going to these URLs, all you see is the UiPath related information, most likely no group policy will overwrite the settings. However, if there is anything unrelated to UiPath, most likely these settings will be overwritten. In such a case, your domain admin has to update their browser group polices configuration.
  6. An alternative to installing the extension by group policy is to install it global for all users on the computer. This will only work for Edge and Chrome. See: About The SetupExtensions Tool .
    1. Chrome option: /ChromeGlobal
    2. Edge option: /Edge-Chromium-Global
    3. Firefox: There is no option for this. See the next step.
    4. If the extension is installed globally for edge or Chrome, it still needs to be enabled on the browser. The first time the automation runs in the pip window, wait for the browser to open and then enable the extension (typically there will be a notification about it).
    5. It has to be the Robot that opens the browser. If the browser is opened manually it will try to load the default profile.
  7. Since there is no option for installing Firefox, another workaround is needed.
    1. Either use the problematic automation or make a simple test automation for debugging the issue.
      1. It's important that that automation does three things:
        1. That it opens a browser in a PiP session.
        2. That the open browser activity uses the BrowserUserDataFolderMode with the setting Default or Custom.
        3. When it errors out, it does not close the browser. - This is important because we need the browser to be opened with the alternative profile.
      2. Either using a test automation or the automation having issues, reproduce the behavior.
      3. Once the issue has reproduced, close the PiP window. Running the automation should have created a temporary browser folder.
      4. Go to %localappdata%\UiPath\PIP Browser Profiles\Firefox or if using a custom folder go to \PIP Browser Profiles\Firefox
      5. Create a directory called "extensions"
      6. In the directory, we need to copy a file.
        1. Source File: C:\Program Files\UiPath\Studio\UiPath\BrowserExtension\uipath-ff.xpi
        2. Copy the above file into the extensions folder. After it is copied in, rename it to extension4ff@uipath.com.xpi
      7. Run the test automation again.
      8. Once the browser opens, go to about:addons
      9. Enable the UiPath Web Automation Extension.