Skip to content

Commit cd352c7

Browse files
committed
Remove redundant trustedtype fix
1 parent 87028cd commit cd352c7

File tree

1 file changed

+3
-8
lines changed
  • protocol-generator/cdp-kotlin-generator/src/main/kotlin/org/hildan/chrome/devtools/protocol/preprocessing

1 file changed

+3
-8
lines changed

protocol-generator/cdp-kotlin-generator/src/main/kotlin/org/hildan/chrome/devtools/protocol/preprocessing/JsonPreProcessor.kt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,9 @@ internal fun List<JsonDomain>.preprocessed(): List<JsonDomain> = this
1212
.makeNewExperimentalPropsOptional()
1313
// Workaround for https://github.com/ChromeDevTools/devtools-protocol/issues/317
1414
.transformDomainTypeProperty("Network", "Cookie", "expires") { it.copy(optional = true) }
15-
// Workaround for https://issues.chromium.org/issues/444471169
16-
// We both add the "trustedType" enum value because we know it pops uo even though it's not in the protocol,
17-
// but we also mark the enum as non-exhaustive, as suggested by Google folks, because more values may be unknown.
18-
.transformDomainTypeProperty("Runtime", "RemoteObject", "subtype") {
19-
// Temporarily conditional because the new protocol versions have this value now
20-
val newValues = if ("trustedtype" !in it.enum.orEmpty()) listOf("trustedtype") else emptyList()
21-
it.copy(enum = it.enum.orEmpty() + newValues, isNonExhaustiveEnum = true)
22-
}
15+
// We mark the enum as non-exhaustive, as suggested by Google folks, because more values may be unknown.
16+
// See https://issues.chromium.org/issues/444471169
17+
.transformDomainTypeProperty("Runtime", "RemoteObject", "subtype") { it.copy(isNonExhaustiveEnum = true) }
2318
// Workaround for https://github.com/ChromeDevTools/devtools-protocol/issues/244
2419
.map { it.pullNestedEnumsToTopLevel() }
2520

0 commit comments

Comments
 (0)