UserScript constructor

UserScript({
  1. String? groupName,
  2. required String source,
  3. required UserScriptInjectionTime injectionTime,
  4. @Deprecated("Use forMainFrameOnly instead") bool? iosForMainFrameOnly,
  5. bool forMainFrameOnly = true,
  6. Set<String>? allowedOriginRules,
  7. ContentWorld? contentWorld,
})

Implementation

UserScript({
  this.groupName,
  required this.source,
  required this.injectionTime,
  @Deprecated("Use forMainFrameOnly instead") this.iosForMainFrameOnly,
  this.forMainFrameOnly = true,
  Set<String>? allowedOriginRules,
  ContentWorld? contentWorld,
}) {
  this.allowedOriginRules = allowedOriginRules != null
      ? allowedOriginRules
      : Set.from(["*"]);
  this.contentWorld = contentWorld ?? ContentWorld.PAGE;
  this.forMainFrameOnly = this.iosForMainFrameOnly != null
      ? this.iosForMainFrameOnly!
      : this.forMainFrameOnly;
}