Safari Developer Library

Developer

SafariPrivateBrowsing Class Reference

Options
Deployment Target:

On This Page

SafariPrivateBrowsing

The SafariPrivateBrowsing class allows you to determine whether Safari currently has Private Browsing enabled. Private Browsing mode disables the ability for Safari to store cookies, browsing history, search history, caches, and Autofill information. If Private Browsing is enabled, you should make efforts not to track the user’s browsing behavior and respect their decision to browse privately.

  • enabled Property

    A Boolean value indicating whether Private Browsing is currently enabled.

    Use the read-only SafariBrowserTab.private property instead.

    Declaration

    readonly attribute boolean enabled;

    Discussion

    The Activate event fires before Private Browsing is enabled, and the Deactivate event fires after Private Browsing is disabled.

    Availability

    Available in Safari 6; deprecated in Safari 9.0.