Package org.mozilla.geckoview
Class ContentBlocking.Settings
Object
org.mozilla.geckoview.RuntimeSettings
org.mozilla.geckoview.ContentBlocking.Settings
- All Implemented Interfaces:
Parcelable
- Enclosing class:
- ContentBlocking
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface android.os.Parcelable
Parcelable.ClassLoaderCreator<T extends Object>, Parcelable.Creator<T extends Object>
-
Field Summary
FieldsFields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
Method Summary
Modifier and TypeMethodDescriptionint
Get the set anti-tracking categories.boolean
Indicates if cookie banner handling detect only mode is enabled.int
Gets the current cookie banner handling mode.int
Gets the current cookie banner handling mode for private browsing.int
Get the assigned cookie storage behavior.int
Get the assigned private mode cookie storage behavior.boolean
Get whether or not cookie purging is enabled.int
Get the set ETP behavior level.int
Get the set safe browsing categories.String[]
Get the table for SafeBrowsing Malware.String[]
Get the table for SafeBrowsing Phishing.Get the collection ofContentBlocking.SafeBrowsingProvider
for this runtime.boolean
Get whether or not strict social tracking protection is enabled.setAntiTracking
(int cat) Set anti-tracking categories.setCookieBannerDetectOnlyMode
(boolean enabled) When set to true, cookie banners are detected and detection events are dispatched, but they will not be handled.setCookieBannerMode
(int mode) Set the Cookie Banner Handling Mode to the new providedContentBlocking.CBCookieBannerMode
value.setCookieBannerModePrivateBrowsing
(int mode) Set the Cookie Banner Handling Mode for private browsing to the new providedContentBlocking.CBCookieBannerMode
value.setCookieBehavior
(int behavior) Set cookie storage behavior.setCookieBehaviorPrivateMode
(int behavior) Set cookie storage behavior for private browsing mode.setCookiePurging
(boolean enabled) Enable or disable cookie purging.setEnhancedTrackingProtectionLevel
(int level) Set the ETP behavior level.setSafeBrowsing
(int cat) Set safe browsing categories.setSafeBrowsingMalwareTable
(String... table) Sets the table for SafeBrowsing Malware.setSafeBrowsingPhishingTable
(String... table) Sets the table for SafeBrowsing Phishing.setSafeBrowsingProviders
(ContentBlocking.SafeBrowsingProvider... providers) Sets the collection ofContentBlocking.SafeBrowsingProvider
for this runtime.setStrictSocialTrackingProtection
(boolean enabled) Set whether or not strict social tracking protection is enabled (ie, whether to block content or just cookies).protected void
updatePrefs
(RuntimeSettings settings) Update the prefs based on the provided settings.Methods inherited from class org.mozilla.geckoview.RuntimeSettings
describeContents, readFromParcel, writeToParcel
-
Field Details
-
CREATOR
-
-
Method Details
-
updatePrefs
Description copied from class:RuntimeSettings
Update the prefs based on the provided settings.- Overrides:
updatePrefs
in classRuntimeSettings
- Parameters:
settings
- Copy from this settings.
-
getSafeBrowsingProviders
Get the collection ofContentBlocking.SafeBrowsingProvider
for this runtime.- Returns:
- an unmodifiable collection of
ContentBlocking.SafeBrowsingProvider
- See Also:
-
setSafeBrowsingProviders
@NonNull public ContentBlocking.Settings setSafeBrowsingProviders(@NonNull ContentBlocking.SafeBrowsingProvider... providers) Sets the collection ofContentBlocking.SafeBrowsingProvider
for this runtime.By default the collection is composed of
ContentBlocking.GOOGLE_LEGACY_SAFE_BROWSING_PROVIDER
andContentBlocking.GOOGLE_SAFE_BROWSING_PROVIDER
.- Parameters:
providers
-ContentBlocking.SafeBrowsingProvider
instances for this runtime.- Returns:
- the
ContentBlocking.Settings
instance. - See Also:
-
getSafeBrowsingPhishingTable
Get the table for SafeBrowsing Phishing. The identifiers present in this table must match one of the identifiers present inContentBlocking.SafeBrowsingProvider.getLists()
.- Returns:
- an array of identifiers for SafeBrowsing's Phishing feature
- See Also:
-
setSafeBrowsingPhishingTable
Sets the table for SafeBrowsing Phishing.- Parameters:
table
- an array of identifiers for SafeBrowsing's Phishing feature.- Returns:
- this
ContentBlocking.Settings
instance. - See Also:
-
getSafeBrowsingMalwareTable
Get the table for SafeBrowsing Malware. The identifiers present in this table must match one of the identifiers present inContentBlocking.SafeBrowsingProvider.getLists()
.- Returns:
- an array of identifiers for SafeBrowsing's Malware feature
- See Also:
-
setSafeBrowsingMalwareTable
Sets the table for SafeBrowsing Malware.- Parameters:
table
- an array of identifiers for SafeBrowsing's Malware feature.- Returns:
- this
ContentBlocking.Settings
instance. - See Also:
-
setAntiTracking
Set anti-tracking categories.- Parameters:
cat
- The categories of resources that should be blocked. Use one or more of theContentBlocking.AntiTracking
flags.- Returns:
- This Settings instance.
-
setEnhancedTrackingProtectionLevel
Set the ETP behavior level.- Parameters:
level
- The level of ETP blocking to use; must be one ofContentBlocking.EtpLevel
flags. Only takes effect if the cookie behavior isContentBlocking.CookieBehavior.ACCEPT_NON_TRACKERS
orContentBlocking.CookieBehavior.ACCEPT_FIRST_PARTY_AND_ISOLATE_OTHERS
.- Returns:
- This Settings instance.
-
setStrictSocialTrackingProtection
Set whether or not strict social tracking protection is enabled (ie, whether to block content or just cookies). Will only block if social tracking protection lists are supplied tosetAntiTracking(int)
.- Parameters:
enabled
- A boolean indicating whether or not to enable strict social tracking protection.- Returns:
- This Settings instance.
-
setSafeBrowsing
Set safe browsing categories.- Parameters:
cat
- The categories of resources that should be blocked. Use one or more of theContentBlocking.SafeBrowsing
flags.- Returns:
- This Settings instance.
-
getAntiTrackingCategories
public int getAntiTrackingCategories()Get the set anti-tracking categories.- Returns:
- The categories of resources to be blocked.
-
getEnhancedTrackingProtectionLevel
public int getEnhancedTrackingProtectionLevel()Get the set ETP behavior level.- Returns:
- The current ETP level; one of
ContentBlocking.EtpLevel
.
-
getStrictSocialTrackingProtection
public boolean getStrictSocialTrackingProtection()Get whether or not strict social tracking protection is enabled.- Returns:
- A boolean indicating whether or not strict social tracking protection is enabled.
-
getSafeBrowsingCategories
public int getSafeBrowsingCategories()Get the set safe browsing categories.- Returns:
- The categories of resources to be blocked.
-
getCookieBehavior
public int getCookieBehavior()Get the assigned cookie storage behavior.- Returns:
- The assigned behavior, as one of
ContentBlocking.CookieBehavior
flags.
-
setCookieBehavior
Set cookie storage behavior.- Parameters:
behavior
- The storage behavior that should be applied. Use one of theContentBlocking.CookieBehavior
flags.- Returns:
- This Settings instance.
-
getCookieBehaviorPrivateMode
public int getCookieBehaviorPrivateMode()Get the assigned private mode cookie storage behavior.- Returns:
- The assigned behavior, as one of
ContentBlocking.CookieBehavior
flags.
-
setCookieBehaviorPrivateMode
Set cookie storage behavior for private browsing mode.- Parameters:
behavior
- The storage behavior that should be applied. Use one of theContentBlocking.CookieBehavior
flags.- Returns:
- This Settings instance.
-
getCookiePurging
public boolean getCookiePurging()Get whether or not cookie purging is enabled.- Returns:
- A boolean indicating whether or not cookie purging is enabled.
-
setCookiePurging
Enable or disable cookie purging. This will automatically purge cookies from tracking sites that have no recent user interaction, provided the cookie behavior is set toContentBlocking.CookieBehavior.ACCEPT_NON_TRACKERS
orContentBlocking.CookieBehavior.ACCEPT_FIRST_PARTY_AND_ISOLATE_OTHERS
.- Parameters:
enabled
- A boolean indicating whether to enable cookie purging.- Returns:
- This Settings instance.
-
setCookieBannerMode
Set the Cookie Banner Handling Mode to the new providedContentBlocking.CBCookieBannerMode
value.- Parameters:
mode
- Integer indicating the new mode.- Returns:
- This Settings instance.
-
setCookieBannerDetectOnlyMode
When set to true, cookie banners are detected and detection events are dispatched, but they will not be handled. Requires the service to be enabled for the desired mode via setCookieBannerMode.- Parameters:
enabled
- A boolean indicating whether to enable cookie banners.- Returns:
- This Settings instance.
-
getCookieBannerDetectOnlyMode
public boolean getCookieBannerDetectOnlyMode()Indicates if cookie banner handling detect only mode is enabled.- Returns:
- boolean indicating if the cookie banner handling detect only mode setting is enabled.
-
getCookieBannerMode
public int getCookieBannerMode()Gets the current cookie banner handling mode.- Returns:
- int the current cookie banner handling mode, one of the
ContentBlocking.CBCookieBannerMode
.
-
setCookieBannerModePrivateBrowsing
Set the Cookie Banner Handling Mode for private browsing to the new providedContentBlocking.CBCookieBannerMode
value.- Parameters:
mode
- Integer indicating the new mode.- Returns:
- This Settings instance.
-
getCookieBannerModePrivateBrowsing
public int getCookieBannerModePrivateBrowsing()Gets the current cookie banner handling mode for private browsing.- Returns:
- int the current cookie banner handling mode, one of the
ContentBlocking.CBCookieBannerMode
.
-