Let's delve into the concept of Private Browsing with these resources:
Private Browsing, as explained on Apple's support page, involves Safari not storing your browsing history and requesting websites not to track you.
For more information, check out this link:http://en.wikipedia.org/wiki/Privacy_mode
Privacy mode or "private browsing" is a feature in certain web browsers that disables browsing history and the web cache. It allows users to browse without saving data locally, including cookies and Flash cookies. However, the privacy protection remains limited to the local device, as identifying frequented sites through IP address association is still possible.
In essence, using Selenium is akin to activating Private Browsing. Each time a driver is launched via Selenium, a new anonymous profile is established, ensuring private browsing (unless an existing safari profile is utilized).
If you feel the need to run Safari in incognito mode, a workaround can be implemented:
You can automate enabling Private Browsing with AppleScript. Here's how:
Start by enabling the 'Enable Access for Assistive Devices' option in the Universal Access system preference.
Open Script Editor located within the AppleScript folder in Applications, and input the following script:
tell application "Safari"
activate
end tell
tell application "System Events"
tell process "Safari"
tell menu bar 1
tell menu bar item "Safari"
tell menu "Safari"
click menu item "Private Browsing"
end tell
end tell
end tell
end tell
end tell
Source: