|
|
@ -636,7 +636,6 @@ class AnalyzeRule(val ruleData: RuleDataInterface) : JsExtensions { |
|
|
|
* 执行JS |
|
|
|
* 执行JS |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
fun evalJS(jsStr: String, result: Any?): Any? { |
|
|
|
fun evalJS(jsStr: String, result: Any?): Any? { |
|
|
|
return runBlocking { |
|
|
|
|
|
|
|
val bindings = SimpleBindings() |
|
|
|
val bindings = SimpleBindings() |
|
|
|
bindings["java"] = this |
|
|
|
bindings["java"] = this |
|
|
|
bindings["cookie"] = CookieStore |
|
|
|
bindings["cookie"] = CookieStore |
|
|
@ -647,6 +646,7 @@ class AnalyzeRule(val ruleData: RuleDataInterface) : JsExtensions { |
|
|
|
bindings["chapter"] = chapter |
|
|
|
bindings["chapter"] = chapter |
|
|
|
bindings["title"] = chapter?.title |
|
|
|
bindings["title"] = chapter?.title |
|
|
|
bindings["src"] = content |
|
|
|
bindings["src"] = content |
|
|
|
|
|
|
|
return runBlocking { |
|
|
|
SCRIPT_ENGINE.eval(jsStr, bindings) |
|
|
|
SCRIPT_ENGINE.eval(jsStr, bindings) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|