diff options
author | Allan Wang <me@allanwang.ca> | 2018-02-02 21:05:26 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-02 21:05:26 -0500 |
commit | d68ea6d7eb8cadf687308fa3204386b79df0556b (patch) | |
tree | 0797c5c53e09b6af5eb996ab42e1f814ee615561 /app/src/main/kotlin/com/pitchedapps/frost/injectors/JsActions.kt | |
parent | f36e0fff23abb5c892b40d1a9fb70776078976c4 (diff) | |
download | frost-d68ea6d7eb8cadf687308fa3204386b79df0556b.tar.gz frost-d68ea6d7eb8cadf687308fa3204386b79df0556b.tar.bz2 frost-d68ea6d7eb8cadf687308fa3204386b79df0556b.zip |
Feature/post (#696)v1.8.1
* Reorder final override
* Add initial fab bindings
* Update scripts
* Optimize and use js header hider
* Remove old header hider
* Use method for generating clicker
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/injectors/JsActions.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/injectors/JsActions.kt | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/injectors/JsActions.kt b/app/src/main/kotlin/com/pitchedapps/frost/injectors/JsActions.kt index 53eb9ede..7be8cd3c 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/injectors/JsActions.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/injectors/JsActions.kt @@ -16,6 +16,8 @@ enum class JsActions(body: String) : InjectorContract { LOGIN_CHECK("document.getElementById('signup-button')&&Frost.loadLogin();"), BASE_HREF("""document.write("<base href='$FB_URL_BASE'/>");"""), FETCH_BODY("""setTimeout(function(){var e=document.querySelector("main");e||(e=document.querySelector("body")),Frost.handleHtml(e.outerHTML)},1e2);"""), + CREATE_POST(clickBySelector("button[name=view_overview]")), +// CREATE_MSG(clickBySelector("a[rel=dialog]")), /** * Used as a pseudoinjector for maybe functions */ @@ -25,4 +27,9 @@ enum class JsActions(body: String) : InjectorContract { override fun inject(webView: WebView, callback: (() -> Unit)?) = JsInjector(function).inject(webView, callback) -}
\ No newline at end of file + +} + +@Suppress("NOTHING_TO_INLINE") +private inline fun clickBySelector(selector: String): String = + """document.querySelector("$selector").click()"""
\ No newline at end of file |