diff --git a/front_end/generated/InspectorBackendCommands.js b/front_end/generated/InspectorBackendCommands.js index cceac1d990..7be0642594 100644 --- a/front_end/generated/InspectorBackendCommands.js +++ b/front_end/generated/InspectorBackendCommands.js @@ -225,11 +225,19 @@ export function registerCommands(inspectorBackend) { inspectorBackend.registerEnum( 'Audits.HeavyAdReason', {NetworkTotalLimit: 'NetworkTotalLimit', CpuTotalLimit: 'CpuTotalLimit', CpuPeakLimit: 'CpuPeakLimit'}); + inspectorBackend.registerEnum('Audits.ContentSecurityPolicyViolationType', { + KInlineViolation: 'kInlineViolation', + KEvalViolation: 'kEvalViolation', + KURLViolation: 'kURLViolation', + KTrustedTypesSinkViolation: 'kTrustedTypesSinkViolation', + KTrustedTypesPolicyViolation: 'kTrustedTypesPolicyViolation' + }); inspectorBackend.registerEnum('Audits.InspectorIssueCode', { SameSiteCookieIssue: 'SameSiteCookieIssue', MixedContentIssue: 'MixedContentIssue', BlockedByResponseIssue: 'BlockedByResponseIssue', - HeavyAdIssue: 'HeavyAdIssue' + HeavyAdIssue: 'HeavyAdIssue', + ContentSecurityPolicyIssue: 'ContentSecurityPolicyIssue' }); inspectorBackend.registerEvent('Audits.issueAdded', ['issue']); inspectorBackend.registerEnum('Audits.GetEncodedResponseRequestEncoding', {Webp: 'webp', Jpeg: 'jpeg', Png: 'png'}); diff --git a/front_end/generated/protocol.d.ts b/front_end/generated/protocol.d.ts index 8e071d42a3..4451582ca2 100644 --- a/front_end/generated/protocol.d.ts +++ b/front_end/generated/protocol.d.ts @@ -850,6 +850,27 @@ declare namespace Protocol { frame: AffectedFrame; } + export enum ContentSecurityPolicyViolationType { + KInlineViolation = 'kInlineViolation', + KEvalViolation = 'kEvalViolation', + KURLViolation = 'kURLViolation', + KTrustedTypesSinkViolation = 'kTrustedTypesSinkViolation', + KTrustedTypesPolicyViolation = 'kTrustedTypesPolicyViolation', + } + + export interface ContentSecurityPolicyIssueDetails { + /** + * The url not included in allowed sources. + */ + blockedURL?: string; + /** + * Specific directive that is violated, causing the CSP issue. + */ + violatedDirective: string; + contentSecurityPolicyViolationType: ContentSecurityPolicyViolationType; + frameAncestor?: AffectedFrame; + } + /** * A unique identifier for the type of issue. Each type may use one of the * optional fields in InspectorIssueDetails to convey more specific @@ -860,6 +881,7 @@ declare namespace Protocol { MixedContentIssue = 'MixedContentIssue', BlockedByResponseIssue = 'BlockedByResponseIssue', HeavyAdIssue = 'HeavyAdIssue', + ContentSecurityPolicyIssue = 'ContentSecurityPolicyIssue', } /** @@ -872,6 +894,7 @@ declare namespace Protocol { mixedContentIssueDetails?: MixedContentIssueDetails; blockedByResponseIssueDetails?: BlockedByResponseIssueDetails; heavyAdIssueDetails?: HeavyAdIssueDetails; + contentSecurityPolicyIssueDetails?: ContentSecurityPolicyIssueDetails; } /** diff --git a/third_party/blink/public/devtools_protocol/browser_protocol.json b/third_party/blink/public/devtools_protocol/browser_protocol.json index f47b011251..4f80526098 100644 --- a/third_party/blink/public/devtools_protocol/browser_protocol.json +++ b/third_party/blink/public/devtools_protocol/browser_protocol.json @@ -1189,6 +1189,43 @@ } ] }, + { + "id": "ContentSecurityPolicyViolationType", + "type": "string", + "enum": [ + "kInlineViolation", + "kEvalViolation", + "kURLViolation", + "kTrustedTypesSinkViolation", + "kTrustedTypesPolicyViolation" + ] + }, + { + "id": "ContentSecurityPolicyIssueDetails", + "type": "object", + "properties": [ + { + "name": "blockedURL", + "description": "The url not included in allowed sources.", + "optional": true, + "type": "string" + }, + { + "name": "violatedDirective", + "description": "Specific directive that is violated, causing the CSP issue.", + "type": "string" + }, + { + "name": "contentSecurityPolicyViolationType", + "$ref": "ContentSecurityPolicyViolationType" + }, + { + "name": "frameAncestor", + "optional": true, + "$ref": "AffectedFrame" + } + ] + }, { "id": "InspectorIssueCode", "description": "A unique identifier for the type of issue. Each type may use one of the\noptional fields in InspectorIssueDetails to convey more specific\ninformation about the kind of issue.", @@ -1197,7 +1234,8 @@ "SameSiteCookieIssue", "MixedContentIssue", "BlockedByResponseIssue", - "HeavyAdIssue" + "HeavyAdIssue", + "ContentSecurityPolicyIssue" ] }, { @@ -1224,6 +1262,11 @@ "name": "heavyAdIssueDetails", "optional": true, "$ref": "HeavyAdIssueDetails" + }, + { + "name": "contentSecurityPolicyIssueDetails", + "optional": true, + "$ref": "ContentSecurityPolicyIssueDetails" } ] }, diff --git a/third_party/blink/public/devtools_protocol/browser_protocol.pdl b/third_party/blink/public/devtools_protocol/browser_protocol.pdl index 486197a2fb..35a994a12b 100644 --- a/third_party/blink/public/devtools_protocol/browser_protocol.pdl +++ b/third_party/blink/public/devtools_protocol/browser_protocol.pdl @@ -597,6 +597,23 @@ experimental domain Audits # The frame that was blocked. AffectedFrame frame + type ContentSecurityPolicyViolationType extends string + enum + kInlineViolation + kEvalViolation + kURLViolation + kTrustedTypesSinkViolation + kTrustedTypesPolicyViolation + + type ContentSecurityPolicyIssueDetails extends object + properties + # The url not included in allowed sources. + optional string blockedURL + # Specific directive that is violated, causing the CSP issue. + string violatedDirective + ContentSecurityPolicyViolationType contentSecurityPolicyViolationType + optional AffectedFrame frameAncestor + # A unique identifier for the type of issue. Each type may use one of the # optional fields in InspectorIssueDetails to convey more specific # information about the kind of issue. @@ -606,6 +623,7 @@ experimental domain Audits MixedContentIssue BlockedByResponseIssue HeavyAdIssue + ContentSecurityPolicyIssue # This struct holds a list of optional fields with additional information # specific to the kind of issue. When adding a new issue code, please also @@ -616,6 +634,7 @@ experimental domain Audits optional MixedContentIssueDetails mixedContentIssueDetails optional BlockedByResponseIssueDetails blockedByResponseIssueDetails optional HeavyAdIssueDetails heavyAdIssueDetails + optional ContentSecurityPolicyIssueDetails contentSecurityPolicyIssueDetails # An inspector issue reported from the back-end. type InspectorIssue extends object