From c3ad96af1db7b457005b13f693ee855bbbc7a80b Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Tue, 2 Apr 2019 23:34:49 -0400 Subject: [PATCH] Show header when not jewel nav --- .idea/inspectionProfiles/profiles_settings.xml | 6 ++++++ .../com/pitchedapps/frost/injectors/CssHider.kt | 2 +- .../com/pitchedapps/frost/injectors/JsAssets.kt | 2 +- .../frost/web/FrostWebViewClients.kt | 1 - .../com/pitchedapps/frost/web/LoginWebView.kt | 1 - app/src/web/assets/js/header_hider.js | 12 ------------ app/src/web/assets/js/header_hider.ts | 17 ----------------- 7 files changed, 8 insertions(+), 33 deletions(-) create mode 100644 .idea/inspectionProfiles/profiles_settings.xml delete mode 100644 app/src/web/assets/js/header_hider.js delete mode 100644 app/src/web/assets/js/header_hider.ts diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 000000000..30d5fbc6c --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file 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 292b7ff5a..891a1dbfc 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 e0be79778..ad42418e5 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 c5c4ad28c..003ed7f91 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 c21ce93bc..1c300b039 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 faa9f66d8..000000000 --- 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 1a8f27f26..000000000 --- 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 - } - - (header).style.display = 'none' -}).call(undefined); - -