blob: a2eb69071769d33c215d75d17298105cf898aef9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
package com.pitchedapps.frost.events
import com.pitchedapps.frost.web.FrostWebViewCore
/**
* Created by Allan Wang on 2017-05-31.
*/
class WebEvent(val key: Int, val urlMatch: String? = null) {
companion object {
const val REFRESH = 0
const val REFRESH_BASE = 1
}
fun execute(webView: FrostWebViewCore) {
if (urlMatch != null && !webView.url.contains(urlMatch)) return
when (key) {
REFRESH -> webView.reload()
REFRESH_BASE -> webView.loadUrl(webView.baseUrl)
}
}
}
|