How to use headless mode
If you use automation for your profile, you will probably like to reduce the amount of windows on your screen. Headless feature helps you out with that. In this article, you will learn how to use it.
What headless feature is good for
- Faster automation
- Makes workflow on GUI more convenient
- Resource efficiency: profiles with headless mode require less than in standard mode
Preparations before using headless mode
The best way to use headless mode is using the script itself. Not sure where to start? Read the steps below.
Step 1: choose the automation framework
Follow the article and make a decision which framework may be the best for your use case: How to choose the best automation framework
Still not sure which framework to use? Consider using Selenium as it is one of the easiest one to get into. Use the following article for reference: Selenium automation example.
Step 2: make a script or use the reference script
You will need to create a script, which will connect to the Multilogin API. It will also use GET Start Browser Profile endpoint. Don't know how to write it? We have reference scripts, which you can use and edit accordingly.
Reference scripts:
Step 3: enable headless mode in the endpoint parameter
Find GET Start Browser Profile endpoint in your script (or the reference script). For example, in Selenium reference script you may find the endpoint:
`https://launcher.mlx.yt:45001/api/v2/profile/f/${folder_id}/p/${profile_id}/start?automation_type=puppeteer&headless_mode=false`
You will need to edit the headless_mode
value to true. The endpoint will look the following way:
`https://launcher.mlx.yt:45001/api/v2/profile/f/${folder_id}/p/${profile_id}/start?automation_type=puppeteer&headless_mode=true`
After that, you can run it via IDE (software for writing and editing scripts), terminal/Command Prompt or our Script runner tool, which is available for Postman and Multilogin CLI. In the next chapters, you will learn how to use Script runner for that.
Keep in mind, that the steps below are related to Script runner.
- If you want to launch the script via IDE, you need to refer to the documentation of your IDE
- If you want to launch the script via terminal (or Command Prompt/Powershell in Windows), you have to refer to the documentation of the programming language your script has been written in. For example, there are official docs related to Python usage and installation:
- Windows: Using Python on Windows
- macOS: Using Python on macOS
- Linux: Using Python on Unix Platforms – On Linux
How to run the script via Script runner (in Postman)
Step 1: put the script in the Multilogin scripts folder
If you want to run the script via Script runner, you should put your script in the corresponding folder.
- Go to the
scripts
folder in Multilogin X directory:- Windows:
C:\Users\%username%\mlx\deps\scripts
- macOS:
/Users/%username%/mlx\deps\scripts
- Linux:
/home/%username%/mlx/deps/scripts
- Windows:
- Paste your script there. E.g., it will be a script called
profile.py
Step 2: install and configure Postman
In order to launch Script runner, you have to configure Postman. Follow the next article before the step called “Add the CookieRobot script”: How to launch CookieRobot using Script runner in Postman.
Step 3: edit the request body
After you configured and opened GET Start Script Runner endpoint in Postman, you need to edit the request body. It will look the following way:
{
"script_file": "<string>",
"profile_ids": [
{
"profile_id": "<string>"
}
]
}
Here is what you need to do:
- Replace the
script_file
value with the title of the script. In our case it isprofile.py
- Replace
profile_id
value with the ID of the profile you want to run. You can find it by following the article: How to copy profile IDs in Multilogin X - Add
is_headless
parameter, and set its value totrue
Your request will have the following structure:
{
"script_file": "<string>",
"profile_ids": [
{
"profile_id": "<string>",
"is_headless": true
}
]
}

Step 4: run the script
After all the preparations, click “Send” button.
How to run the script via Script runner (in Multilogin CLI)
Step 1: put the script in the Multilogin scripts folder
If you want to run the script via Script runner, you should put your script in the corresponding folder.
- Go to the
scripts
folder in Multilogin X directory:- Windows:
C:\Users\%username%\mlx\deps\scripts
- macOS:
/Users/%username%/mlx\deps\scripts
- Linux:
/home/%username%/mlx/deps/scripts
- Windows:
- Paste your script there. E.g., it will be a script called
profile.py
Step 2: launch and configure Multilogin CLI
Follow the steps from the article: How to use Script runner with Multilogin CLI.
Step 3: run your script
After you launched Multilogin CLI, you can run the script and configure the profile launch in headless mode. You will need to type start-script
command with --script
and --profile-id
flags. Also, the headless value :true
is set to --profile-id
flag. In the end, the command will be the following:
- Windows:
xcli start-script --script <your script title> --profile-id <profile id>:true
- macOS/Linux:
./xcli start-script --script <your script title> --profile-id <profile id>:true
Replace <profile id>
value with the ID of the profile you want to run. You can find it by following the article: How to copy profile IDs in Multilogin X
