mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
This commit is contained in:
@@ -988,6 +988,7 @@ interface JsExtensions : JsEncodeUtils {
|
||||
|
||||
// 新增 mimeType 参数,默认为 null(保持兼容性)
|
||||
fun openUrl(url: String, mimeType: String? = null) {
|
||||
require(url.length < 64 * 1024) { "openUrl parameter url too long" }
|
||||
rhinoContext.ensureActive()
|
||||
val source = getSource() ?: throw NoStackTraceException("openUrl source cannot be null")
|
||||
appCtx.startActivity<OpenUrlConfirmActivity> {
|
||||
|
||||
@@ -39,9 +39,8 @@ object SourceVerificationHelp {
|
||||
): String {
|
||||
source
|
||||
?: throw NoStackTraceException("getVerificationResult parameter source cannot be null")
|
||||
if (isMainThread) {
|
||||
error("getVerificationResult must be called on a background thread")
|
||||
}
|
||||
require(url.length < 64 * 1024) { "getVerificationResult parameter url too long" }
|
||||
check(!isMainThread) { "getVerificationResult must be called on a background thread" }
|
||||
|
||||
clearResult(source.getKey())
|
||||
|
||||
@@ -85,6 +84,7 @@ object SourceVerificationHelp {
|
||||
refetchAfterSuccess: Boolean? = true
|
||||
) {
|
||||
source ?: throw NoStackTraceException("startBrowser parameter source cannot be null")
|
||||
require(url.length < 64 * 1024) { "startBrowser parameter url too long" }
|
||||
appCtx.startActivity<WebViewActivity> {
|
||||
putExtra("title", title)
|
||||
putExtra("url", url)
|
||||
|
||||
Reference in New Issue
Block a user