diff options
author | Allan Wang <me@allanwang.ca> | 2020-05-23 18:36:41 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2020-05-23 18:36:41 -0700 |
commit | c7cfb2c8682b223e5949735a015cb920934b36cd (patch) | |
tree | fae5c6a5a42e327ea86d91a9397f8e68e76ebea5 /app/src/main/kotlin/com/pitchedapps/frost/injectors | |
parent | 7c8e02d385d418ebae1f8f718b72c4170a1bc819 (diff) | |
download | frost-c7cfb2c8682b223e5949735a015cb920934b36cd.tar.gz frost-c7cfb2c8682b223e5949735a015cb920934b36cd.tar.bz2 frost-c7cfb2c8682b223e5949735a015cb920934b36cd.zip |
Create full size image css
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/injectors')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/injectors/CssHider.kt | 4 | ||||
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/injectors/CssSmallAssets.kt | 20 |
2 files changed, 22 insertions, 2 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssHider.kt b/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssHider.kt index 94367853..9630117d 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssHider.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssHider.kt @@ -24,7 +24,7 @@ import com.pitchedapps.frost.utils.Prefs * * List of elements to hide */ -enum class CssHider(vararg val items: String) : InjectorContract { +enum class CssHider(private vararg val items: String) : InjectorContract { CORE("[data-sigil=m_login_upsell]", "[role=progressbar]"), HEADER( "#header:not(.mFuturePageHeader):not(.titled)", @@ -51,7 +51,7 @@ enum class CssHider(vararg val items: String) : InjectorContract { val injector: JsInjector by lazy { JsBuilder().css("${items.joinToString(separator = ",")}{display:none !important}") - .single(name).build() + .single("css-hider-$name").build() } override fun inject(webView: WebView, prefs: Prefs) = diff --git a/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssSmallAssets.kt b/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssSmallAssets.kt new file mode 100644 index 00000000..e2485c71 --- /dev/null +++ b/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssSmallAssets.kt @@ -0,0 +1,20 @@ +package com.pitchedapps.frost.injectors + +import android.webkit.WebView +import com.pitchedapps.frost.utils.Prefs + +/** + * Small misc inline css assets + */ +enum class CssSmallAssets(private val content: String) : InjectorContract { + FullSizeImage("div._4prr[style*=\"max-width\"][style*=\"max-height\"]{max-width:none !important;max-height:none !important}") + ; + + val injector: JsInjector by lazy { + JsBuilder().css(content).single("css-small-assets-$name").build() + } + + override fun inject(webView: WebView, prefs: Prefs) { + injector.inject(webView, prefs) + } +}
\ No newline at end of file |