How to open browser URL in incognito?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Numox

Using OS.shell_open("https://google.com") works fine for opening a website in normal mode. How do I open the same link in incognito?

:bust_in_silhouette: Reply From: Numox

I figured it out in case anyone has this problem:

var array = ["-incognito", "--new-window https://google.com"]
var args = PoolStringArray(array)
var path = ("c:\\Program Files(x86)\\Google\\Chrome\\Application\\chrome.exe")
OS.execute(path, args, true) 

If you don’t use --new-window part and only copy URL, it will not open incognito if you already have an open non-incognito browser.