WebResources

表示插件信息.

Author

M8Test, [email protected], https://m8test.com

Functions

Link copied to clipboard
abstract fun afterDownload(listener: (WebResource, ScriptFile?, Throwable?) -> Unit)

添加资源下载结束监听器.

Link copied to clipboard
abstract fun beforeDownload(listener: (WebResource) -> ScriptFile?)

添加资源下载前监听器, 资源下载前会调用 listener, 可以实现资源版本同步功能.

Link copied to clipboard
abstract override fun close()

关闭当前对象, 如果没有调用本方法则会报错, 当然本方法由系统调用, 不需要手动调用.

Link copied to clipboard
abstract fun download(config: WebResource.() -> Unit): ScriptFile?

下载指定的资源并返回下载到本地的文件.

Link copied to clipboard
abstract fun getContext(): ScriptContext

获取脚本上下文对象 ScriptContext.

Link copied to clipboard
abstract fun getGlobalName(): String

获取作为全局变量时的名称.

Link copied to clipboard
abstract fun getPublicType(): Type

获取 Variable 注入到脚本时需要显示的类型.

Link copied to clipboard
abstract fun isClosed(): Boolean

判断当前对象是否已经调用了 close 方法.

Link copied to clipboard
abstract fun isPrefixRequired(): Boolean

是否需要添加前缀, 每种编程语言添加的前缀不一样, 前缀可以通过 Language.getVariablePrefix 获取.

Link copied to clipboard
abstract fun isSuffixRequired(): Boolean

是否需要添加后缀, 每种编程语言添加的后缀不一样, 后缀可以通过 Language.getVariableSuffix 获取.

Link copied to clipboard
abstract fun onDownload(listener: (webResource: WebResource, progress: Int) -> Unit)

添加资源下载进度, 下载进度改变时会调用 listener 函数.