ContentBlocker class

Class that represents a set of rules to use block content in the browser window.

On iOS and MacOS, it uses WKContentRuleListStore. On Android, it uses a custom implementation because such functionality doesn't exist.

In general, this article can be used to get an overview about this functionality but on Android there are two types of action that are unavailable: block-cookies and ignore-previous-rules.

Constructors

ContentBlocker({required ContentBlockerTrigger trigger, required ContentBlockerAction action})

Properties

action ContentBlockerAction
Action associated to the trigger. The action tells to the WebView what to do when the trigger is matched.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
trigger ContentBlockerTrigger
Trigger of the content blocker. The trigger tells to the WebView when to perform the corresponding action.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() Map<String, Map<String, dynamic>>
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

fromMap(Map<dynamic, Map> map) ContentBlocker