diff --git a/api/chrome-devtools-kotlin.api b/api/chrome-devtools-kotlin.api index 63ef9152..cb2fa646 100644 --- a/api/chrome-devtools-kotlin.api +++ b/api/chrome-devtools-kotlin.api @@ -46463,22 +46463,27 @@ public final class org/hildan/chrome/devtools/protocol/ChromeDPClientKt { public final class org/hildan/chrome/devtools/protocol/ChromeDPTarget { public static final field Companion Lorg/hildan/chrome/devtools/protocol/ChromeDPTarget$Companion; - public synthetic fun (ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V - public fun (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V + public synthetic fun (ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V + public fun (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V + public synthetic fun (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ljava/lang/String; public final fun component2 ()Ljava/lang/String; public final fun component3 ()Ljava/lang/String; public final fun component4 ()Ljava/lang/String; public final fun component5 ()Ljava/lang/String; public final fun component6 ()Ljava/lang/String; - public final fun copy (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lorg/hildan/chrome/devtools/protocol/ChromeDPTarget; - public static synthetic fun copy$default (Lorg/hildan/chrome/devtools/protocol/ChromeDPTarget;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Lorg/hildan/chrome/devtools/protocol/ChromeDPTarget; + public final fun component7 ()Ljava/lang/String; + public final fun component8 ()Ljava/lang/String; + public final fun copy (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lorg/hildan/chrome/devtools/protocol/ChromeDPTarget; + public static synthetic fun copy$default (Lorg/hildan/chrome/devtools/protocol/ChromeDPTarget;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Lorg/hildan/chrome/devtools/protocol/ChromeDPTarget; public fun equals (Ljava/lang/Object;)Z public final fun getDescription ()Ljava/lang/String; public final fun getDevtoolsFrontendUrl ()Ljava/lang/String; + public final fun getFaviconUrl ()Ljava/lang/String; public final fun getId ()Ljava/lang/String; public final fun getTitle ()Ljava/lang/String; public final fun getType ()Ljava/lang/String; + public final fun getUrl ()Ljava/lang/String; public final fun getWebSocketDebuggerUrl ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; diff --git a/src/commonMain/kotlin/org/hildan/chrome/devtools/protocol/ChromeDPClient.kt b/src/commonMain/kotlin/org/hildan/chrome/devtools/protocol/ChromeDPClient.kt index 11cf5aca..2ae4219b 100644 --- a/src/commonMain/kotlin/org/hildan/chrome/devtools/protocol/ChromeDPClient.kt +++ b/src/commonMain/kotlin/org/hildan/chrome/devtools/protocol/ChromeDPClient.kt @@ -207,11 +207,13 @@ data class ChromeDPTarget( val title: String, val type: String, val description: String, + val url: String, val devtoolsFrontendUrl: String, /** * The web socket URL to use with [HttpClient.chromeWebSocket] to connect via the debugger to this target. */ val webSocketDebuggerUrl: String, + val faviconUrl: String? = null, ) /** diff --git a/src/jvmTest/kotlin/IntegrationTests.kt b/src/jvmTest/kotlin/IntegrationTests.kt index 87fb468c..03058160 100644 --- a/src/jvmTest/kotlin/IntegrationTests.kt +++ b/src/jvmTest/kotlin/IntegrationTests.kt @@ -39,11 +39,15 @@ class IntegrationTests { assertTrue(version.userAgent.contains("HeadlessChrome")) assertTrue(version.webSocketDebuggerUrl.startsWith("ws://localhost")) + val protocolJson = chrome.protocolJson() + assertTrue(protocolJson.isNotEmpty(), "the JSON definition of the protocol should not be empty") + val targets = chrome.targets() assertTrue(targets.isNotEmpty(), "there should be at least the about:blank target") - val protocolJson = chrome.protocolJson() - assertTrue(protocolJson.isNotEmpty(), "the JSON definition of the protocol should not be empty") + val googleTab = chrome.newTab("https://www.google.com") + assertEquals("https://www.google.com", googleTab.url.trimEnd('/')) + chrome.closeTab(googleTab.id) } }