From f448eaf4c21c40778663f2d11b6f6f8ad8855b0f Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Mon, 22 Nov 2021 12:06:07 -0800 Subject: Default menu to home as some entries forcefully redirect there --- app/src/main/kotlin/com/pitchedapps/frost/facebook/FbItem.kt | 12 +++++++++--- .../main/kotlin/com/pitchedapps/frost/injectors/CssAsset.kt | 4 ++-- .../kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbItem.kt b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbItem.kt index 5d4df797..7d9d5c12 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbItem.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbItem.kt @@ -46,14 +46,20 @@ enum class FbItem( FRIENDS(R.string.friends, GoogleMaterial.Icon.gmd_person_add, "friends/center/requests"), GROUPS(R.string.groups, GoogleMaterial.Icon.gmd_group, "groups"), MARKETPLACE(R.string.marketplace, GoogleMaterial.Icon.gmd_store, "marketplace"), + /* * Unlike other urls, menus cannot be linked directly as it is a soft reference. Instead, we can * pick any url with the blue bar and manually click to enter the menu. - * The notifications page was picked arbitrarily as I assume it has the smallest loading footprint. + * We pick home.php as some back interactions default to home regardless of the base url. */ - MENU(R.string.menu, GoogleMaterial.Icon.gmd_menu, "notifications.php"), + MENU(R.string.menu, GoogleMaterial.Icon.gmd_menu, "home.php"), MESSAGES(R.string.messages, MaterialDesignIconic.Icon.gmi_comments, "messages"), - MESSENGER(R.string.messenger, CommunityMaterial.Icon2.cmd_facebook_messenger, "", prefix = HTTPS_MESSENGER_COM), + MESSENGER( + R.string.messenger, + CommunityMaterial.Icon2.cmd_facebook_messenger, + "", + prefix = HTTPS_MESSENGER_COM + ), NOTES(R.string.notes, CommunityMaterial.Icon3.cmd_note, "notes"), NOTIFICATIONS(R.string.notifications, MaterialDesignIconic.Icon.gmi_globe, "notifications"), ON_THIS_DAY(R.string.on_this_day, GoogleMaterial.Icon.gmd_today, "onthisday"), diff --git a/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssAsset.kt b/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssAsset.kt index a1f66520..39e2332a 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssAsset.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssAsset.kt @@ -26,9 +26,9 @@ enum class CssAsset(private val content: String) : InjectorContract { FullSizeImage("div._4prr[style*=\"max-width\"][style*=\"max-height\"]{max-width:none !important;max-height:none !important}"), /* - * Remove top margin and hide some contents from the top bar and notification page (as it's our base url) + * Remove top margin and hide some contents from the top bar and home page (as it's our base url) */ - Menu("#bookmarks_flyout{margin-top:0 !important}#notifications_list{display:none !important}") + Menu("#bookmarks_flyout{margin-top:0 !important}#m_news_feed_stream,#MComposer{display:none !important}") ; val injector: JsInjector by lazy { 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 ad7f7858..3b332199 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt @@ -135,7 +135,7 @@ open class FrostWebViewClient(val web: FrostWebView) : BaseWebViewClient() { JsAssets.DOCUMENT_WATCHER, JsAssets.HORIZONTAL_SCROLLING, JsAssets.AUTO_RESIZE_TEXTAREA.maybe(prefs.autoExpandTextBox), -// JsAssets.CLICK_A, + JsAssets.CLICK_A, JsAssets.CONTEXT_A, JsAssets.MEDIA, JsAssets.SCROLL_STOP, -- cgit v1.2.3