UserScript class

Class that represents a script that the WebView injects into the web page.

Constructors

UserScript({String? groupName, required String source, required UserScriptInjectionTime injectionTime, @Deprecated("Use forMainFrameOnly instead") bool? iosForMainFrameOnly, bool forMainFrameOnly = true, Set<String>? allowedOriginRules, ContentWorld? contentWorld})

Properties

allowedOriginRules Set<String>
A set of matching rules for the allowed origins.
getter/setter pair
contentWorld ContentWorld
A scope of execution in which to evaluate the script to prevent conflicts between different scripts. For more information about content worlds, see ContentWorld.
getter/setter pair
forMainFrameOnly bool
A Boolean value that indicates whether to inject the script into the main frame. Specify true to inject the script only into the main frame, or false to inject it into all frames. The default value is true.
getter/setter pair
groupName String?
The script’s group name.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
injectionTime UserScriptInjectionTime
The time at which to inject the script into the WebView.
getter/setter pair
iosForMainFrameOnly bool?
Use forMainFrameOnly instead.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
source String
The script’s source code.
getter/setter pair

Methods

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

Operators

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

Static Methods

fromMap(Map<String, dynamic>? map) UserScript?
Gets a possible UserScript instance from a Map value.