ContentSecurityPolicyIssueDetails.fromJson constructor

ContentSecurityPolicyIssueDetails.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory ContentSecurityPolicyIssueDetails.fromJson(
    Map<String, dynamic> json) {
  return ContentSecurityPolicyIssueDetails(
    blockedURL:
        json.containsKey('blockedURL') ? json['blockedURL'] as String : null,
    violatedDirective: json['violatedDirective'] as String,
    isReportOnly: json['isReportOnly'] as bool? ?? false,
    contentSecurityPolicyViolationType:
        ContentSecurityPolicyViolationType.fromJson(
            json['contentSecurityPolicyViolationType'] as String),
    frameAncestor: json.containsKey('frameAncestor')
        ? AffectedFrame.fromJson(
            json['frameAncestor'] as Map<String, dynamic>)
        : null,
    sourceCodeLocation: json.containsKey('sourceCodeLocation')
        ? SourceCodeLocation.fromJson(
            json['sourceCodeLocation'] as Map<String, dynamic>)
        : null,
    violatingNodeId: json.containsKey('violatingNodeId')
        ? dom.BackendNodeId.fromJson(json['violatingNodeId'] as int)
        : null,
  );
}