Skip to content

Commit

Permalink
build: 2.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cssxsh committed Apr 27, 2024
1 parent b9f9852 commit f81dbc5
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# 2.6.0(24/04/27)

1. fix: npm mirror
2. update: commons-compress 1.26.1
3. update: selenium-java 4.20.0

# 2.5.1(23/09/08)

1. feat: setup chrome command
1. feat: setup chrome command

# 2.5.0 (23/08/12)

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

> Mirai Selenium 前置插件
Mirai-Console的前置插件,用于使用Selenium调用浏览器进行截图等
Mirai-Console 的前置插件,用于使用 Selenium 调用浏览器进行截图等

[![maven-central](https://img.shields.io/maven-central/v/xyz.cssxsh.mirai/mirai-selenium-plugin)](https://search.maven.org/artifact/xyz.cssxsh.mirai/mirai-selenium-plugin)
[![Setup](https://github.com/cssxsh/mirai-selenium-plugin/actions/workflows/setup.yml/badge.svg?branch=master)](https://github.com/cssxsh/mirai-selenium-plugin/actions/workflows/setup.yml)
[![Setup and Build](https://github.com/cssxsh/mirai-selenium-plugin/actions/workflows/setup.yml/badge.svg)](https://github.com/cssxsh/mirai-selenium-plugin/actions/workflows/setup.yml)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/2ac22c6b3f4a4ce5a205971ad0e53412)](https://www.codacy.com/gh/cssxsh/mirai-selenium-plugin/dashboard?utm_source=github.com&utm_medium=referral&utm_content=cssxsh/mirai-selenium-plugin&utm_campaign=Badge_Grade)

## 运行平台支持

| OS | Browser | Driver | Setup |
|:-------:|:-------:|:------:|:-----:|
| Windows | Chrome | Yes | Yes |
| Windows | Firefox | Yes | Yes |
| Windows | Firefox | Yes | No |
| Windows | Edge | Yes | ~ |
| Linux | Chrome | Yes | Yes |
| Linux | Firefox | Yes | Yes |
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

group = "xyz.cssxsh.mirai"
version = "2.5.1"
version = "2.6.0"

mavenCentralPublish {
useCentralS01()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public object MiraiSeleniumPlugin : KotlinPlugin(
JvmPluginDescription(
id = "xyz.cssxsh.mirai.plugin.mirai-selenium-plugin",
name = "mirai-selenium-plugin",
version = "2.5.1"
version = "2.6.0"
) {
author("cssxsh")
}
Expand Down
22 changes: 8 additions & 14 deletions src/main/kotlin/xyz/cssxsh/selenium/SeleniumTool.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,31 +37,25 @@ internal val SeleniumLogger: Logger = Logger.getLogger("org.openqa.selenium")

// region RemoteWebDriver

/**
* @see org.openqa.selenium.remote.service.DriverService.process
* @see org.openqa.selenium.os.ExternalProcess.process
*/
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
internal fun DriverService.getProcess(): Process? {
/**
* @see org.openqa.selenium.remote.service.DriverService.process
*/
val external = DriverService::class.java.getDeclaredField("process")
.apply { isAccessible = true }.get(this) ?: return null

/**
* @see org.openqa.selenium.os.ExternalProcess.process
*/
return external::class.java.getDeclaredField("process")
.apply { isAccessible = true }.get(external) as? Process
}

/**
* @see org.openqa.selenium.remote.RemoteWebDriver.executor
* @see org.openqa.selenium.remote.HttpCommandExecutor.httpClientFactory
*/
internal fun RemoteWebDriver.getHttpClientFactory(): HttpClient.Factory? {
/**
* @see org.openqa.selenium.remote.RemoteWebDriver.executor
*/
val executor = RemoteWebDriver::class.java.getDeclaredField("executor")
.apply { isAccessible = true }.get(this) ?: return null

/**
* @see org.openqa.selenium.remote.HttpCommandExecutor.httpClientFactory
*/
return HttpCommandExecutor::class.java.getDeclaredField("httpClientFactory")
.apply { isAccessible = true }.get(executor) as? HttpClient.Factory
}
Expand Down

0 comments on commit f81dbc5

Please sign in to comment.