Mac – Force Safari to operate in Private Mode and detect that state from a webserver

macmac-osx

I have an internal application that needs to be accessed by employees from their Macs at home. We have a way to facilitate this access, but have some concerns that information could be unintentionally leaked via the browser cache.

For Windows platforms, we have software that is part of the remote access solution that will allow us to clear the browser cache. For the Macs, no such solution exists — but Safari private mode will address our concerns.

Does anyone know of a way to write a script that will open Safari in private mode and write a cookie or some other artifact that would indicate to the server that the script launched Safari?

Best Answer

To have Private Browsing always enabled:

defaults write com.apple.Safari WebKitPrivateBrowsingEnabled true

It's supposed to work - but seems in testing to be rather sporadic as to when it actually works and when it doesn't.

The above is incorrect. The key WebKitPrivateBrowsingEnabled is only available via MCX and simply allows one to disable to the Private Browsing feature all together in Safari. So at the moment there is no way to have Private Browsing automatically enabled in Safari.

Related Topic