Problem

For JS7 - Kiosk Mode users have to automate start-up of the browser, opening of the JOC Cockpit URL and login to JOC Cockpit. To this purpose the article suggests the example of a PowerShell script that starts the Firefox browser. There can be a number of other ways how to do it. This article is focused on troubleshooting when using the PowerShell example:


Example how to start the Firefox browser and how to login in unattended mode from PowerShell
Add-Type -AssemblyName microsoft.VisualBasic
Add-Type -AssemblyName System.Windows.Forms

Start-Process -FilePath "C:\Program Files\Mozilla Firefox\firefox.exe" -argumentlist "-P default","-fullscreen","-kiosk","-url http://localhost:4446/joc/#/login"
Start-Sleep -Seconds 5

[Microsoft.VisualBasic.Interaction]::AppActivate("Firefox")
[System.Windows.Forms.SendKeys]::SendWait("{ENTER}");


The PowerShell script might fail to open Firefox in Kiosk Mode or might not load the JOC Cockpit URL. Additionally, users may encounter errors related to script execution policies when running the script for the first time,

Analysis

Solution

  • Firefox Installation Path and Default Browser:
    • Verify that Firefox is installed in the default location (C:\Program Files\Mozilla Firefox\firefox.exe).
    • Set Firefox as the default browser in Settings > Default apps to avoid Kiosk Mode launch issues.
  • Incorrect Firefox Profile:
    • Open Firefox and type about:profiles in the address bar to display existing profiles.
    • If "default" is missing, create a new profile and update the script to reference that profile name.
    • Modify the script to use the correct profile name
  • Script Execution Policy Restrictions:
    • Run PowerShell as Administrator.
    • Use the following command to allow execution of scripts:
      • Set-ExecutionPolicy RemoteSigned
      • Confirm the policy change if requested by PowerShell.
    • If the issue persists, use this command:
      • Set-ExecutionPolicy Bypass
      • Confirm the policy change if requested by PowerShell.