aboutsummaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-04-02 23:34:49 -0400
committerAllan Wang <me@allanwang.ca>2019-04-02 23:34:49 -0400
commitc3ad96af1db7b457005b13f693ee855bbbc7a80b (patch)
treed1ede75b5b2383852bb2a27330bff87c26be4467 /app/src
parentd2fc0356ad90645a772876d60dcf80f3ec869d39 (diff)
downloadfrost-c3ad96af1db7b457005b13f693ee855bbbc7a80b.tar.gz
frost-c3ad96af1db7b457005b13f693ee855bbbc7a80b.tar.bz2
frost-c3ad96af1db7b457005b13f693ee855bbbc7a80b.zip
Show header when not jewel nav
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/injectors/CssHider.kt2
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/injectors/JsAssets.kt2
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt1
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt1
-rw-r--r--app/src/web/assets/js/header_hider.js12
-rw-r--r--app/src/web/assets/js/header_hider.ts17
6 files changed, 2 insertions, 33 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 292b7ff5..891a1dbf 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssHider.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssHider.kt
@@ -26,7 +26,7 @@ import android.webkit.WebView
enum class CssHider(vararg val items: String) : InjectorContract {
CORE("[data-sigil=m_login_upsell]", "[role=progressbar]"),
HEADER(
- "#header", "#mJewelNav", "[data-sigil=MTopBlueBarHeader]",
+ "#header:not(.mFuturePageHeader):not(.titled)", "#mJewelNav", "[data-sigil=MTopBlueBarHeader]",
"#header-notices", "[data-sigil*=m-promo-jewel-header]"
),
ADS(
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/injectors/JsAssets.kt b/app/src/main/kotlin/com/pitchedapps/frost/injectors/JsAssets.kt
index e0be7977..ad42418e 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/injectors/JsAssets.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/injectors/JsAssets.kt
@@ -33,7 +33,7 @@ import java.util.Locale
* The enum name must match the css file name
*/
enum class JsAssets : InjectorContract {
- MENU, CLICK_A, CONTEXT_A, MEDIA, HEADER_BADGES, HEADER_HIDER, TEXTAREA_LISTENER, NOTIF_MSG,
+ MENU, CLICK_A, CONTEXT_A, MEDIA, HEADER_BADGES, TEXTAREA_LISTENER, NOTIF_MSG,
DOCUMENT_WATCHER
;
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 c5c4ad28..003ed7f9 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt
@@ -105,7 +105,6 @@ open class FrostWebViewClient(val web: FrostWebView) : BaseWebViewClient() {
JsAssets.CLICK_A,
CssHider.ADS.maybe(!Prefs.showFacebookAds),
JsAssets.CONTEXT_A,
-// JsAssets.HEADER_HIDER,
JsAssets.MEDIA
)
else
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt
index c21ce93b..1c300b03 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt
@@ -98,7 +98,6 @@ class LoginWebView @JvmOverloads constructor(
view.setBackgroundColor(Color.TRANSPARENT)
if (url.isFacebookUrl)
view.jsInject(
- JsAssets.HEADER_HIDER,
CssHider.CORE,
Prefs.themeInjector
)
diff --git a/app/src/web/assets/js/header_hider.js b/app/src/web/assets/js/header_hider.js
deleted file mode 100644
index faa9f66d..00000000
--- a/app/src/web/assets/js/header_hider.js
+++ /dev/null
@@ -1,12 +0,0 @@
-"use strict";
-(function () {
- var header = document.querySelector('#header');
- if (!header) {
- return;
- }
- var jewel = header.querySelector('#mJewelNav');
- if (!jewel) {
- return;
- }
- header.style.display = 'none';
-}).call(undefined);
diff --git a/app/src/web/assets/js/header_hider.ts b/app/src/web/assets/js/header_hider.ts
deleted file mode 100644
index 1a8f27f2..00000000
--- a/app/src/web/assets/js/header_hider.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-(function () {
- const header = document.querySelector('#header');
-
- if (!header) {
- return
- }
-
- const jewel = header.querySelector('#mJewelNav');
-
- if (!jewel) {
- return
- }
-
- (<HTMLElement>header).style.display = 'none'
-}).call(undefined);
-
-