Page 1 of 1

Launch FireFox or Chrome hidden

Posted: 21 Apr 2018, 06:51
by Georgie Munteer
I tried something like

Run, %A_ProgramFiles%\Mozilla Firefox\firefox.exe www.google.com, Hidden

or

Run, %A_ProgramFiles%\Mozilla Firefox\firefox.exe www.google.com, Hide

same with Chrome

it always pops up the window

I cannot use IE so com is out

Any tips guys?

Re: Launch FireFox or Chrome hidden

Posted: 21 Apr 2018, 08:32
by swagfag
what do u mean by hidden?

you can start a headless chrome instance with Chrome.ahk

Re: Launch FireFox or Chrome hidden

Posted: 21 Apr 2018, 14:46
by Xtra
Run
Run, Target [, WorkingDir, Max|Min|Hide|UseErrorLevel, OutputVarPID]

Notice the commas compared to yours? (Hint: Hide is not the WorkingDir)

Try:
Run, %A_ProgramFiles%\Mozilla Firefox\firefox.exe http://www.google.com,, Hide

Re: Launch FireFox or Chrome hidden

Posted: 22 Apr 2018, 00:33
by Georgie Munteer
Xtra wrote:Run
Run, Target [, WorkingDir, Max|Min|Hide|UseErrorLevel, OutputVarPID]

Notice the commas compared to yours? (Hint: Hide is not the WorkingDir)

Try:
Run, %A_ProgramFiles%\Mozilla Firefox\firefox.exe http://www.google.com,, Hide
You are right I made a mistake with the comma.

Can you test it, even with the right setup, the firefox window pops up

Re: Launch FireFox or Chrome hidden

Posted: 22 Apr 2018, 01:51
by Xtra
I don't use firefox you may want to run firefox not as admin see here: How do I not run Firefox as an Administrator or run your script as admin.

Re: Launch FireFox or Chrome hidden

Posted: 22 Apr 2018, 01:56
by gregster
But even if you could launch Firefox hidden this way, there is no good way to work with it after that. The above mentioned Chrome.ahk library by Geekdude would be the better alternative (but using Chrome - which seems ok according to the OP): https://autohotkey.com/boards/viewtopic ... e+geekdude

But I think even this library will use the COM IE interface (via an ActiveX element) to establish the Websocket API connection. There is still the Selenium Webdriver - but that means installation of third-party software.