Skip to content

Commit 1a92f18

Browse files
committed
fix: make connection and tab factory method protected
1 parent e5a2b3b commit 1a92f18

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

core/src/commonMain/kotlin/dev/kdriver/core/browser/DefaultBrowser.kt

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -88,23 +88,11 @@ open class DefaultBrowser(
8888

8989
}
9090

91-
open fun createConnection(websocketUrl: String, targetInfo: Target.TargetInfo? = null): Connection {
92-
return DefaultConnection(
93-
websocketUrl = websocketUrl,
94-
messageListeningScope = coroutineScope,
95-
targetInfo = targetInfo,
96-
owner = this
97-
)
98-
}
91+
protected open fun createConnection(websocketUrl: String, targetInfo: Target.TargetInfo? = null): Connection =
92+
DefaultConnection(websocketUrl, coroutineScope, targetInfo, this)
9993

100-
open fun createTab(websocketUrl: String, targetInfo: Target.TargetInfo): Tab {
101-
return DefaultTab(
102-
websocketUrl,
103-
messageListeningScope = coroutineScope,
104-
targetInfo = targetInfo,
105-
owner = this
106-
)
107-
}
94+
protected open fun createTab(websocketUrl: String, targetInfo: Target.TargetInfo): Tab =
95+
DefaultTab(websocketUrl, coroutineScope, targetInfo, this)
10896

10997
override suspend fun wait(timeout: Long): Browser {
11098
delay(timeout)

0 commit comments

Comments
 (0)