aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/web
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/web')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt2
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/FrostRequestInterceptor.kt2
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt4
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt5
4 files changed, 8 insertions, 5 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt
index 4c4e5525..ac62f142 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt
@@ -82,7 +82,7 @@ class DebugWebView @JvmOverloads constructor(
if (url.isFacebookUrl)
view.jsInject(
CssAssets.ROUND_ICONS.maybe(Prefs.showRoundedIcons),
- CssHider.CORE,
+// CssHider.CORE,
CssHider.COMPOSER.maybe(!Prefs.showComposer),
CssHider.PEOPLE_YOU_MAY_KNOW.maybe(!Prefs.showSuggestedFriends),
CssHider.SUGGESTED_GROUPS.maybe(!Prefs.showSuggestedGroups),
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostRequestInterceptor.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostRequestInterceptor.kt
index 72e448b9..4e4df027 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostRequestInterceptor.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostRequestInterceptor.kt
@@ -23,7 +23,7 @@ fun WebView.shouldFrostInterceptRequest(request: WebResourceRequest): WebResourc
val host = httpUrl.host()
val url = httpUrl.toString()
if (host.contains("facebook") || host.contains("fbcdn")) return null
- if (FrostPglAdBlock.isAdHost(host)) return blankResource
+ if (FrostPglAdBlock.isAd(host)) return blankResource
// if (!shouldLoadImages && !Prefs.loadMediaOnMeteredNetwork && request.isMedia) return blankResource
L.v { "Intercept Request: $host $url" }
return null
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt
index b58f1a16..b83002a3 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt
@@ -76,7 +76,9 @@ fun FrostWebView.requestWebOverlay(url: String): Boolean {
/**
* If the url contains any one of the whitelist segments, switch to the chat overlay
*/
-val messageWhitelist = setOf(FbItem.MESSAGES, FbItem.CHAT, FbItem.FEED_MOST_RECENT, FbItem.FEED_TOP_STORIES).map { it.url }.toSet()
+val messageWhitelist: Set<String> =
+ setOf(FbItem.MESSAGES, FbItem.CHAT, FbItem.FEED_MOST_RECENT, FbItem.FEED_TOP_STORIES)
+ .mapTo(mutableSetOf(), FbItem::url)
val String.shouldUseBasicAgent: Boolean
get() {
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt
index a1fd594f..8824e635 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt
@@ -65,7 +65,8 @@ open class FrostWebViewClient(val web: FrostWebView) : BaseWebViewClient() {
if (url.isFacebookUrl)
view.jsInject(
CssAssets.ROUND_ICONS.maybe(Prefs.showRoundedIcons),
- CssHider.CORE,
+// CssHider.CORE,
+ CssHider.HEADER,
CssHider.COMPOSER.maybe(!Prefs.showComposer),
CssHider.PEOPLE_YOU_MAY_KNOW.maybe(!Prefs.showSuggestedFriends),
CssHider.SUGGESTED_GROUPS.maybe(!Prefs.showSuggestedGroups),
@@ -76,7 +77,7 @@ open class FrostWebViewClient(val web: FrostWebView) : BaseWebViewClient() {
JsAssets.CLICK_A,
CssHider.ADS.maybe(!Prefs.showFacebookAds),
JsAssets.CONTEXT_A,
- JsAssets.HEADER_HIDER,
+// JsAssets.HEADER_HIDER,
JsAssets.MEDIA)
else
refresh.onNext(false)