If you're talking about "private browsing mode" as "incognito mode", it's easy.
You can control FireFox by using GUI Scripting (via System Events).
"keystroke" command can make key press event. "click" command can make menu click event.
Whole GUI Scripting how-to is in my ebook.
https://piyomarusoft.booth.pm/items/4230018
Topic:
App & System Services
SubTopic:
Automation & Scripting
Tags: