I'm trying to write AppleScript which would tell whether a window of Safari is in private mode. Here is the AppleScript to do so in Chrome:
tell application "Google Chrome"
set incognitoIsRunning to the (count of (get every window whose mode is "incognito")) is greater than 0
end tell
if (incognitoIsRunning) then
return "-- PRIVATE MODE --"
end tell
The old solution to see whether private browsing menu option is checked no longer works.