Skip to content

Commit

Permalink
build: 2.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
cssxsh committed Feb 4, 2022
1 parent 41a69ec commit 0026dd0
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 22 deletions.
12 changes: 6 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ plugins {
kotlin("jvm") version "1.6.0"
kotlin("plugin.serialization") version "1.6.0"

id("net.mamoe.mirai-console") version "2.10.0-RC2"
id("net.mamoe.maven-central-publish") version "0.7.0"
id("net.mamoe.mirai-console") version "2.10.0"
id("net.mamoe.maven-central-publish") version "0.7.1"
}

group = "xyz.cssxsh.mirai"
version = "2.0.6"
version = "2.0.7"

mavenCentralPublish {
useCentralS01()
Expand All @@ -25,16 +25,16 @@ repositories {
}

dependencies {
api("org.seleniumhq.selenium:selenium-java:4.1.1") {
api("org.seleniumhq.selenium:selenium-java:4.1.2") {
exclude("org.slf4j")
exclude("io.netty")
exclude("com.google.auto.service")
}
compileOnly("com.google.auto.service:auto-service:1.0.1")
compileOnly("net.mamoe:mirai-core-utils:2.10.0-RC2")
compileOnly("net.mamoe:mirai-core-utils:2.10.0")

testImplementation(kotlin("test", "1.6.0"))
testImplementation("org.slf4j:slf4j-simple:1.7.33")
runtimeOnly("org.slf4j:slf4j-simple:1.7.35")
}

kotlin {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public object MiraiSeleniumPlugin : KotlinPlugin(
JvmPluginDescription(
id = "xyz.cssxsh.mirai.plugin.mirai-selenium-plugin",
name = "mirai-selenium-plugin",
version = "2.0.6",
version = "2.0.7",
) {
author("cssxsh")
}
Expand Down
13 changes: 0 additions & 13 deletions src/main/kotlin/xyz/cssxsh/selenium/SeleniumInit.kt
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,6 @@ internal fun queryVersion(folder: File): String {
?: throw UnsupportedOperationException("无法在 ${folder.absolutePath} 找到版本信息")
}

/**
* [Platform.MAC] 通过 Preferences 获取默认浏览器
*/
internal fun queryPreference(): String {
return ProcessBuilder(
"plutil",
"-p",
"~/Library/Preferences/com.apple.LaunchServices/com.apple.LaunchServices.secure.plist"
)
.start()
.inputStream.use { it.reader().readText() }
}

internal fun HttpMessage.contentDisposition(): ContentDisposition? {
return headers[HttpHeaders.ContentDisposition]?.let { ContentDisposition.parse(it) }
}
Expand Down
1 change: 1 addition & 0 deletions src/main/kotlin/xyz/cssxsh/selenium/SeleniumTool.kt
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ public fun RemoteWebDriver.hide(vararg css: String): List<RemoteWebElement> {
* @param hide CSS过滤器
* @return 返回的图片文件数据,格式PNG
*/
@JvmSynthetic
public suspend fun RemoteWebDriver.getScreenshot(url: String, vararg hide: String): ByteArray {
val home = windowHandle
val tab = switchTo().newWindow(WindowType.TAB) as RemoteWebDriver
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
import org.openqa.selenium.OutputType;
import org.openqa.selenium.remote.RemoteWebDriver;
import xyz.cssxsh.selenium.RemoteWebDriverConfig;
import xyz.cssxsh.selenium.SeleniumToolKt;

import java.io.File;

public class MiraiSeleniumPluginJavaTest extends JavaPlugin {
class MiraiSeleniumPluginJavaTest extends JavaPlugin {
public MiraiSeleniumPluginJavaTest() {
super(new JvmPluginDescriptionBuilder("xyz.cssxsh.mirai.plugin.mirai-selenium-plugin-test", "0.0.0")
.dependsOn("xyz.cssxsh.mirai.plugin.mirai-selenium-plugin", false)
Expand All @@ -18,7 +19,7 @@ public MiraiSeleniumPluginJavaTest() {
/**
* RemoteWebDriverConfig 是接口,可以自己定义
*/
private RemoteWebDriverConfig config = RemoteWebDriverConfig.INSTANCE;
private final RemoteWebDriverConfig config = RemoteWebDriverConfig.INSTANCE;


@Override
Expand Down

0 comments on commit 0026dd0

Please sign in to comment.