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
- Firefox Installation Path and Default Browser : Firefox may not be installed in the expected location (
C:\Program Files\Mozilla Firefox\firefox.exe
). - Incorrect Firefox Profile : The Firefox profile specified (
-P default
) might not exist. - Script Execution Policy Restrictions : This is typically indicated by an error message like this:
"js7-kiosk.ps1 cannot be loaded because running scripts is disabled on this system."
- Administrator Privileges : PowerShell scripts that modify system settings or launch applications in a specific mode may require elevated privileges.
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.
- Verify that Firefox is installed in the default location (
- 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
- Open Firefox and type
- 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.
Overview
Content Tools