InjectDetails constructor

InjectDetails({
  1. String? code,
  2. String? file,
  3. bool? allFrames,
  4. int? frameId,
  5. bool? matchAboutBlank,
  6. RunAt? runAt,
  7. CSSOrigin? cssOrigin,
})

Implementation

InjectDetails({
  /// JavaScript or CSS code to inject.
  ///
  /// **Warning:**
  /// Be careful using the `code` parameter. Incorrect use of it may open your
  /// extension to [cross site
  /// scripting](https://en.wikipedia.org/wiki/Cross-site_scripting) attacks.
  String? code,

  /// JavaScript or CSS file to inject.
  String? file,

  /// If allFrames is `true`, implies that the JavaScript or CSS should be
  /// injected into all frames of current page. By default, it's `false` and
  /// is only injected into the top frame. If `true` and `frameId` is set,
  /// then the code is inserted in the selected frame and all of its child
  /// frames.
  bool? allFrames,

  /// The [frame](webNavigation#frame_ids) where the script or CSS should be
  /// injected. Defaults to 0 (the top-level frame).
  int? frameId,

  /// If matchAboutBlank is true, then the code is also injected in
  /// about:blank and about:srcdoc frames if your extension has access to its
  /// parent document. Code cannot be inserted in top-level about:-frames. By
  /// default it is `false`.
  bool? matchAboutBlank,

  /// The soonest that the JavaScript or CSS will be injected into the tab.
  /// Defaults to "document_idle".
  RunAt? runAt,

  /// The [origin](https://www.w3.org/TR/css3-cascade/#cascading-origins) of
  /// the CSS to inject. This may only be specified for CSS, not JavaScript.
  /// Defaults to `"author"`.
  CSSOrigin? cssOrigin,
}) : _wrapped = $js.InjectDetails(
        code: code,
        file: file,
        allFrames: allFrames,
        frameId: frameId,
        matchAboutBlank: matchAboutBlank,
        runAt: runAt?.toJS,
        cssOrigin: cssOrigin?.toJS,
      );