ScriptInjection class

Constructors

ScriptInjection({JSAny? func, List<Object>? args, JSAny? function, List<String>? files, required InjectionTarget target, ExecutionWorld? world, bool? injectImmediately})
ScriptInjection.fromJS(ScriptInjection _wrapped)

Properties

args List<Object>?
The arguments to pass to the provided function. This is only valid if the func parameter is specified. These arguments must be JSON-serializable.
getter/setter pair
files List<String>?
The path of the JS or CSS files to inject, relative to the extension's root directory. Exactly one of files or func must be specified.
getter/setter pair
func JSAny?
A JavaScript function to inject. This function will be serialized, and then deserialized for injection. This means that any bound parameters and execution context will be lost. Exactly one of files or func must be specified.
getter/setter pair
function JSAny?
We used to call the injected function function, but this is incompatible with JavaScript's object declaration shorthand (see https://crbug.com/1166438). We leave this silently in for backwards compatibility. TODO(devlin): Remove this in M95.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
injectImmediately bool?
Whether the injection should be triggered in the target as soon as possible. Note that this is not a guarantee that injection will occur prior to page load, as the page may have already loaded by the time the script reaches the target.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
target InjectionTarget
Details specifying the target into which to inject the script.
getter/setter pair
toJS → ScriptInjection
no setter
world ExecutionWorld?
The JavaScript "world" to run the script in. Defaults to ISOLATED.
getter/setter pair

Methods

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

Operators

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