From 2a1875a315083653e6299bf525d9ff238188df58 Mon Sep 17 00:00:00 2001 From: Pierre Theo Klein Date: Wed, 20 Mar 2019 13:41:56 -0400 Subject: Edit formatting for markdown in GitHub. I was looking at the docs and noticed that the list rendering etc. was not great. I changed the formatting to work more nicely with Github's markdown renderer. --- docs/Listing.md | 52 +++++++++++++++++++++++++--------------------------- 1 file changed, 25 insertions(+), 27 deletions(-) (limited to 'docs') diff --git a/docs/Listing.md b/docs/Listing.md index e82d09ce..e51c0026 100644 --- a/docs/Listing.md +++ b/docs/Listing.md @@ -1,37 +1,35 @@ -Welcome to Frost for Facebook! +# Welcome to Frost for Facebook Frost is a fully functional web wrapper, with many unique and native features such as: -• True multi user interactions - More than just an option in a settings menu, Frost's account switcher is right in the drawer. You are one tap away from switching accounts, and everything refreshes on the switch so that you can view other accounts instantaneously. Furthermore, the notification service will fetch notifications from all accounts, and will let you know which account has the new notification. -• Better multitasking - Frost contains an overlaying web browser that can be drawn on top of your foreground task. Open links and notifications with a full screen view, then swipe away to get back to your previous task. -• Contextual awareness - Frost integrates additional features via long presses. Need to copy a block of text or share a link? Long press the text. Need to zoom into an image or download it? Long press the image! -• Material Design - Built for lollipop and up, Frost focuses strongly on a beautiful and functional UI, and embraces material transitions and dimensions. -• Complete theme engine - Frost contains very comprehensive themes that customize all components of the app. Frost is also the only app to support transparent themes. -• Fully opened - Nothing speaks for privacy more than being open sourced. Frost is proud to be one of those apps, and can be found on github (Link in the app's about section) -• Fixes the little things - Frost is community driven, and many tweaks are added to address minor inconveniences and give a full native experience, despite being a web app. To list a few: -   • Focusing on a text input will prevent refreshing, so you don't accidentally swipe and lose your progress. -   • Horizontal swipe can be enabled along side the viewpager swipe with a simple long press -   • Automatic bug reports are sent when a crash is detected, so even if you don't contact the devs, you are helping contribute by using the app. +- **True multi user interactions**: More than just an option in a settings menu, Frost's account switcher is right in the drawer. You are one tap away from switching accounts, and everything refreshes on the switch so that you can view other accounts instantaneously. Furthermore, the notification service will fetch notifications from all accounts, and will let you know which account has the new notification. +- **Better multitasking**: Frost contains an overlaying web browser that can be drawn on top of your foreground task. Open links and notifications with a full screen view, then swipe away to get back to your previous task. +- **Contextual awareness**: Frost integrates additional features via long presses. Need to copy a block of text or share a link? Long press the text. Need to zoom into an image or download it? Long press the image! +- **Material Design**: Built for lollipop and up, Frost focuses strongly on a beautiful and functional UI, and embraces material transitions and dimensions. +- **Complete theme engine**: Frost contains very comprehensive themes that customize all components of the app. Frost is also the only app to support transparent themes. +- **Fully opened**: Nothing speaks for privacy more than being open sourced. Frost is proud to be one of those apps, and can be found on github (Link in the app's about section) +- **Fixes the little things**: Frost is community driven, and many tweaks are added to address minor inconveniences and give a full native experience, despite being a web app. To list a few: + - Focusing on a text input will prevent refreshing, so you don't accidentally swipe and lose your progress. + - Horizontal swipe can be enabled along side the viewpager swipe with a simple long press + - Automatic bug reports are sent when a crash is detected, so even if you don't contact the devs, you are helping contribute by using the app. -Mandatory permissions used and why: +## Mandatory permissions used and why -• Internet, Network State, Wifi State - Frost fetches the pages from Facebook's mobile website. It also needs the network state so as to limit internet usage when you are on a metered network. -• Receive Boot Completed - Frost notifications persist on reboot, and need this permission to be added each time. -• Vibrate - Needed to vibrate phone for notifications; this can be toggled in the settings +- **Internet, Network State, Wifi State**: Frost fetches the pages from Facebook's mobile website. It also needs the network state so as to limit internet usage when you are on a metered network. +- **Receive Boot Completed**: Frost notifications persist on reboot, and need this permission to be added each time. +- **Vibrate**: Needed to vibrate phone for notifications; this can be toggled in the settings -Optional permissions used and why: -(these are only requested when they have to be, and are disabled until then) +## Optional permissions used and why *(these are only requested when they have to be, and are disabled until then)* -• Read/write external storage - Needed to upload photos in a new status and save photos when prompted -• Fine/coarse location - Needed for the check in option if users wish to search for their location +- **Read/write external storage**: Needed to upload photos in a new status and save photos when prompted +- **Fine/coarse location**: Needed for the check in option if users wish to search for their location +- That's it! No privacy intrusion and no extra demands. -• That's it! No privacy intrusion and no extra demands. +## Permissions *NOT* used and why -Permissions NOT used and why: +- **Wakelock**: Frost takes advantage of Android's Job Scheduler, and lets the framework decide when to run background services. Frost therefore doesn't need to constantly run in the background, nor does it force your phone to stay awake. +- **Retrieve running apps**: Frost has no need to access external apps or see what else is running +- **Identity**: Frost manages its accounts internally and uses it solely to give you access to your account. We don't depend on other personal information and we don't even save your email. +- **Camera**: While the camera permission can be added to allow you to directly take photos and upload them, we've decided that it would be best to allow you to do so externally and then share the photo with Frost -• Wakelock - Frost takes advantage of Android's Job Scheduler, and lets the framework decide when to run background services. Frost therefore doesn't need to constantly run in the background, nor does it force your phone to stay awake. -• Retrieve running apps - Frost has no need to access external apps or see what else is running -• Identity - Frost manages its accounts internally and uses it solely to give you access to your account. We don't depend on other personal information and we don't even save your email. -• Camera - While the camera permission can be added to allow you to directly take photos and upload them, we've decided that it would be best to allow you to do so externally and then share the photo with Frost - -* Frost is a third party app and is in no way affiliated with Facebook Inc.* +*Frost is a third party app and is in no way affiliated with Facebook Inc.* -- cgit v1.2.3 From 23def966c0e04b8a88285e91130471a561449be0 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sat, 30 Mar 2019 22:44:03 -0400 Subject: Update versions --- app/build.gradle | 1 + build.gradle | 4 ++-- docs/Changelog.md | 4 ++++ gradle.properties | 18 +++++++++--------- 4 files changed, 16 insertions(+), 11 deletions(-) (limited to 'docs') diff --git a/app/build.gradle b/app/build.gradle index 4025568a..409a109b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,6 +7,7 @@ apply plugin: 'com.getkeepsafe.dexcount' apply plugin: 'com.gladed.androidgitversion' apply from: '../spotless.gradle' +group = APP_GROUP android { compileSdkVersion kau.targetSdk diff --git a/build.gradle b/build.gradle index 64e324d2..33031d0b 100644 --- a/build.gradle +++ b/build.gradle @@ -8,13 +8,13 @@ buildscript { dependencies { classpath "ca.allanwang:kau:${KAU}" - classpath 'com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta02' +// classpath 'com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta02' classpath "com.android.tools.build:gradle:${ANDROID_GRADLE}" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${KOTLIN}" classpath "com.bugsnag:bugsnag-android-gradle-plugin:${BUGSNAG_PLUGIN}" classpath "com.diffplug.spotless:spotless-plugin-gradle:${SPOTLESS}" classpath "com.getkeepsafe.dexcount:dexcount-gradle-plugin:${DEX_PLUGIN}" - classpath "gradle.plugin.com.gladed.gradle.androidgitversion:gradle-android-git-version:${GIT_PLUGIN}" + classpath "com.gladed.androidgitversion:gradle-android-git-version:${GIT_PLUGIN}" } wrapper.setDistributionType(Wrapper.DistributionType.ALL) diff --git a/docs/Changelog.md b/docs/Changelog.md index e58b8f5f..4d90b7fb 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -1,5 +1,9 @@ # Changelog +## v2.2.3 +* Add ability to hide stories +* Remove fbclid from urls + ## v2.2.2 * New marketplace shortcut * Fix crash when internet disconnects (may still need app restart) diff --git a/gradle.properties b/gradle.properties index f95fed2b..b1125720 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,22 +15,22 @@ APP_ID=Frost APP_GROUP=com.pitchedapps KAU=4.0.0-alpha02 -KOTLIN=1.3.11 +KOTLIN=1.3.21 # https://mvnrepository.com/artifact/com.android.tools.build/gradle?repo=google -ANDROID_GRADLE=3.2.1 +ANDROID_GRADLE=3.3.2 # https://github.com/diffplug/spotless/blob/master/plugin-gradle/CHANGES.md -SPOTLESS=3.17.0 +SPOTLESS=3.21.1 # https://github.com/bugsnag/bugsnag-android/releases -BUGSNAG=4.9.3 +BUGSNAG=4.12.0 # https://github.com/bugsnag/bugsnag-android-gradle-plugin/releases -BUGSNAG_PLUGIN=3.6.0 +BUGSNAG_PLUGIN=4.1.1 # https://github.com/KeepSafe/dexcount-gradle-plugin/releases DEX_PLUGIN=0.8.5 # https://github.com/gladed/gradle-android-git-version/releases -GIT_PLUGIN=0.4.7 +GIT_PLUGIN=0.4.9 # https://mvnrepository.com/artifact/org.apache.commons/commons-text # Updates blocked due to javax.script dependency COMMONS_TEXT=1.4 @@ -41,7 +41,7 @@ EXOMEDIA=4.3.0 # https://github.com/InsertKoinIO/koin/blob/master/CHANGELOG.md KOIN=1.0.2 # https://github.com/mockk/mockk/releases -MOCKK=1.8.13.kotlin13 +MOCKK=1.9.3 # https://mvnrepository.com/artifact/androidx.core/core-ktx?repo=google KTX=1.0.1 @@ -54,9 +54,9 @@ LEAK_CANARY=1.6.2 # https://github.com/zsmb13/MaterialDrawerKt/releases MATERIAL_DRAWER_KT=2.0.1 # https://github.com/square/okhttp/releases -OKHTTP=3.12.1 +OKHTTP=3.14.0 # http://robolectric.org/getting-started/ -ROBOELECTRIC=4.1 +ROBOELECTRIC=4.2 # https://github.com/davemorrissey/subsampling-scale-image-view#quick-start SCALE_IMAGE_VIEW=3.10.0 # https://github.com/umano/AndroidSlidingUpPanel#importing-the-library -- cgit v1.2.3 From 0b4142715cc84ab5a63cdc766379ef8506c3bc49 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sat, 30 Mar 2019 23:07:43 -0400 Subject: Update changelog and add fbclid test --- app/src/main/res/xml/frost_changelog.xml | 2 +- app/src/test/kotlin/com/pitchedapps/frost/facebook/FbUrlTest.kt | 7 +++++++ docs/Changelog.md | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/app/src/main/res/xml/frost_changelog.xml b/app/src/main/res/xml/frost_changelog.xml index 51a872ec..b535b43c 100644 --- a/app/src/main/res/xml/frost_changelog.xml +++ b/app/src/main/res/xml/frost_changelog.xml @@ -9,7 +9,7 @@ - + diff --git a/app/src/test/kotlin/com/pitchedapps/frost/facebook/FbUrlTest.kt b/app/src/test/kotlin/com/pitchedapps/frost/facebook/FbUrlTest.kt index e2a6f4ae..ca842ed9 100644 --- a/app/src/test/kotlin/com/pitchedapps/frost/facebook/FbUrlTest.kt +++ b/app/src/test/kotlin/com/pitchedapps/frost/facebook/FbUrlTest.kt @@ -83,6 +83,13 @@ class FbUrlTest { assertFbFormat(formattedUrl, url) } + @Test + fun fbclidNonFacebook() { + val url = "https://www.google.ca?foo&fbclid=abc&bar=bbb" + val formattedUrl = "https://www.google.ca?foo&bar=bbb" + assertFbFormat(formattedUrl, url) + } + @Test fun doubleDash() { assertFbFormat("${FB_URL_BASE}relative", "$FB_URL_BASE/relative") diff --git a/docs/Changelog.md b/docs/Changelog.md index 4d90b7fb..f81b2d20 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -3,6 +3,7 @@ ## v2.2.3 * Add ability to hide stories * Remove fbclid from urls +* Apply notification keyword filter to title as well ## v2.2.2 * New marketplace shortcut -- cgit v1.2.3 From f7ad18ff7f1bd10bef45542b4ea400f2957cbf3e Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 31 Mar 2019 23:09:36 -0400 Subject: Apply spotless --- app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt | 1 - app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt | 1 - app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt | 1 - docs/Changelog.md | 2 ++ 4 files changed, 2 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt b/app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt index c8431464..a6437123 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt @@ -28,7 +28,6 @@ import com.pitchedapps.frost.enums.Theme import com.pitchedapps.frost.injectors.CssAssets import com.pitchedapps.frost.utils.Prefs import com.pitchedapps.frost.utils.REQUEST_NAV -import com.pitchedapps.frost.utils.REQUEST_REFRESH import com.pitchedapps.frost.utils.REQUEST_TEXT_ZOOM import com.pitchedapps.frost.utils.frostEvent import com.pitchedapps.frost.utils.frostNavigationBar 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 80edd62e..90c4c7e2 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt @@ -25,7 +25,6 @@ import android.view.View import android.webkit.WebView import ca.allanwang.kau.utils.withAlpha import com.pitchedapps.frost.facebook.USER_AGENT_BASIC -import com.pitchedapps.frost.injectors.CssAssets import com.pitchedapps.frost.injectors.CssHider import com.pitchedapps.frost.injectors.jsInject import com.pitchedapps.frost.utils.L 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 bac27010..c5c4ad28 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt @@ -27,7 +27,6 @@ import com.pitchedapps.frost.facebook.FB_URL_BASE import com.pitchedapps.frost.facebook.FbCookie import com.pitchedapps.frost.facebook.FbItem import com.pitchedapps.frost.facebook.formattedFbUrl -import com.pitchedapps.frost.injectors.CssAssets import com.pitchedapps.frost.injectors.CssHider import com.pitchedapps.frost.injectors.JsActions import com.pitchedapps.frost.injectors.JsAssets diff --git a/docs/Changelog.md b/docs/Changelog.md index f81b2d20..99ba22d2 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -4,6 +4,8 @@ * Add ability to hide stories * Remove fbclid from urls * Apply notification keyword filter to title as well +* Remove round icon settings as they are the default in Facebook +* Update theme ## v2.2.2 * New marketplace shortcut -- cgit v1.2.3 From d0b4471667a3979deddf2c1e947cff301fb4d254 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Thu, 4 Apr 2019 21:28:41 -0400 Subject: Merge mute specific fixes (#1386) * Merge mute specific fixes * Remove version tag in user agent * Add extra forward slash * Update kau --- app/src/main/kotlin/com/pitchedapps/frost/facebook/FbConst.kt | 4 ++-- app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt | 1 + app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt | 6 +++--- docs/Changelog.md | 3 +++ gradle.properties | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) (limited to 'docs') diff --git a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbConst.kt b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbConst.kt index 1d6937f7..8bca6b67 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbConst.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbConst.kt @@ -22,7 +22,7 @@ package com.pitchedapps.frost.facebook const val FACEBOOK_COM = "facebook.com" const val FBCDN_NET = "fbcdn.net" -const val HTTPS_FACEBOOK_COM = "https://$FACEBOOK_COM" +const val HTTPS_FACEBOOK_COM = "https://$FACEBOOK_COM/" const val FB_URL_BASE = "https://m.$FACEBOOK_COM/" fun profilePictureUrl(id: Long) = "https://graph.facebook.com/$id/picture?type=large" const val FB_LOGIN_URL = "${FB_URL_BASE}login" @@ -30,7 +30,7 @@ const val FB_HOME_URL = "${FB_URL_BASE}home.php" // Default user agent const val USER_AGENT_FULL = - "Mozilla/5.0 (Linux; Android 7.1; Mi A1 Build/N2G47H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Mobile Safari/537.36" + "Mozilla/5.0 (Linux; Android 8.0.0; ONEPLUS A3000) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.90 Mobile Safari/537.36" // Basic user agent; non mobile version const val USER_AGENT_BASIC = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36" diff --git a/app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt b/app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt index 0e9d94e6..37b2234d 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt @@ -70,6 +70,7 @@ class FrostWebView @JvmOverloads constructor( else USER_AGENT_FULL with(settings) { javaScriptEnabled = true + mediaPlaybackRequiresUserGesture = false // TODO check if we need this allowFileAccess = true textZoom = Prefs.webTextScaling } 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 90c4c7e2..e278db80 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt @@ -24,7 +24,7 @@ import android.util.AttributeSet import android.view.View import android.webkit.WebView import ca.allanwang.kau.utils.withAlpha -import com.pitchedapps.frost.facebook.USER_AGENT_BASIC +import com.pitchedapps.frost.facebook.USER_AGENT_FULL import com.pitchedapps.frost.injectors.CssHider import com.pitchedapps.frost.injectors.jsInject import com.pitchedapps.frost.utils.L @@ -53,9 +53,9 @@ class DebugWebView @JvmOverloads constructor( } @SuppressLint("SetJavaScriptEnabled") - fun setupWebview() { + private fun setupWebview() { settings.javaScriptEnabled = true - settings.userAgentString = USER_AGENT_BASIC + settings.userAgentString = USER_AGENT_FULL setLayerType(View.LAYER_TYPE_HARDWARE, null) webViewClient = DebugClient() isDrawingCacheEnabled = true diff --git a/docs/Changelog.md b/docs/Changelog.md index 99ba22d2..78f796d6 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -1,5 +1,8 @@ # Changelog +## v2.2.4 +* Show top bar to allow sharing posts + ## v2.2.3 * Add ability to hide stories * Remove fbclid from urls diff --git a/gradle.properties b/gradle.properties index 80b320d7..3e449ebc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,7 +14,7 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryErro APP_ID=Frost APP_GROUP=com.pitchedapps -KAU=998782a +KAU=4.0.0 KOTLIN=1.3.21 # https://mvnrepository.com/artifact/com.android.tools.build/gradle?repo=google -- cgit v1.2.3 From e8c52e6ab127dae71d51b7b54c98bfd724568de3 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sat, 13 Apr 2019 19:52:24 -0400 Subject: Update user agent (#1400) * Rename user agent and update chrome for desktop, resolves #1387 * Rename more basic to desktop * Apply spotless --- app/src/main/AndroidManifest.xml | 2 +- .../frost/activities/WebOverlayActivity.kt | 12 ++++++------ .../com/pitchedapps/frost/debugger/OfflineWebsite.kt | 4 ++-- .../kotlin/com/pitchedapps/frost/facebook/FbConst.kt | 8 ++++---- .../pitchedapps/frost/facebook/requests/FbRequest.kt | 4 ++-- .../kotlin/com/pitchedapps/frost/utils/Downloader.kt | 6 +++--- .../main/kotlin/com/pitchedapps/frost/utils/Utils.kt | 8 ++++---- .../com/pitchedapps/frost/views/FrostWebView.kt | 10 +++++----- .../kotlin/com/pitchedapps/frost/web/DebugWebView.kt | 4 ++-- .../frost/web/FrostUrlOverlayValidator.kt | 20 ++++++++++---------- .../kotlin/com/pitchedapps/frost/web/LoginWebView.kt | 1 - docs/Changelog.md | 4 ++++ 12 files changed, 43 insertions(+), 40 deletions(-) (limited to 'docs') diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index ad1fcbdc..5656860c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -48,7 +48,7 @@ android:launchMode="singleTop" android:theme="@style/FrostTheme.Overlay.Slide" /> >.withEmptyData(vararg key: String): List Context.launchWebOverlay fun Context.launchWebOverlay(url: String) = launchWebOverlayImpl(url) -fun Context.launchWebOverlayBasic(url: String) = launchWebOverlayImpl(url) +fun Context.launchWebOverlayDesktop(url: String) = launchWebOverlayImpl(url) private fun Context.fadeBundle() = ActivityOptions.makeCustomAnimation( this, @@ -393,7 +393,7 @@ fun frostJsoup(cookie: String?, url: String) = Jsoup.connect(url).run { if (cookie.isNullOrBlank()) this else cookie(FACEBOOK_COM, cookie) - }.userAgent(USER_AGENT_BASIC).get()!! + }.userAgent(USER_AGENT_DESKTOP).get()!! fun Element.first(vararg select: String): Element? { select.forEach { diff --git a/app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt b/app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt index 37b2234d..cc8e3fbc 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt @@ -29,8 +29,8 @@ import com.pitchedapps.frost.contracts.FrostContentCore import com.pitchedapps.frost.contracts.FrostContentParent import com.pitchedapps.frost.facebook.FB_HOME_URL import com.pitchedapps.frost.facebook.FbItem -import com.pitchedapps.frost.facebook.USER_AGENT_BASIC -import com.pitchedapps.frost.facebook.USER_AGENT_FULL +import com.pitchedapps.frost.facebook.USER_AGENT_DESKTOP +import com.pitchedapps.frost.facebook.USER_AGENT_MOBILE import com.pitchedapps.frost.fragments.WebFragment import com.pitchedapps.frost.utils.Prefs import com.pitchedapps.frost.utils.frostDownload @@ -38,7 +38,7 @@ import com.pitchedapps.frost.web.FrostChromeClient import com.pitchedapps.frost.web.FrostJSI import com.pitchedapps.frost.web.FrostWebViewClient import com.pitchedapps.frost.web.NestedWebView -import com.pitchedapps.frost.web.shouldUseBasicAgent +import com.pitchedapps.frost.web.shouldUseDesktopAgent /** * Created by Allan Wang on 2017-05-29. @@ -66,8 +66,8 @@ class FrostWebView @JvmOverloads constructor( @SuppressLint("SetJavaScriptEnabled") override fun bind(container: FrostContentContainer): View { userAgentString = - if (parent.baseEnum == FbItem.MESSAGES || parent.baseUrl.shouldUseBasicAgent) USER_AGENT_BASIC - else USER_AGENT_FULL + if (parent.baseEnum == FbItem.MESSAGES || parent.baseUrl.shouldUseDesktopAgent) USER_AGENT_DESKTOP + else USER_AGENT_MOBILE with(settings) { javaScriptEnabled = true mediaPlaybackRequiresUserGesture = false // TODO check if we need this 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 e278db80..6511ef9f 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt @@ -24,7 +24,7 @@ import android.util.AttributeSet import android.view.View import android.webkit.WebView import ca.allanwang.kau.utils.withAlpha -import com.pitchedapps.frost.facebook.USER_AGENT_FULL +import com.pitchedapps.frost.facebook.USER_AGENT_MOBILE import com.pitchedapps.frost.injectors.CssHider import com.pitchedapps.frost.injectors.jsInject import com.pitchedapps.frost.utils.L @@ -55,7 +55,7 @@ class DebugWebView @JvmOverloads constructor( @SuppressLint("SetJavaScriptEnabled") private fun setupWebview() { settings.javaScriptEnabled = true - settings.userAgentString = USER_AGENT_FULL + settings.userAgentString = USER_AGENT_MOBILE setLayerType(View.LAYER_TYPE_HARDWARE, null) webViewClient = DebugClient() isDrawingCacheEnabled = true 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 24885fdf..81ade98f 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt @@ -22,7 +22,7 @@ import com.pitchedapps.frost.activities.WebOverlayActivityBase import com.pitchedapps.frost.contracts.VideoViewHolder import com.pitchedapps.frost.facebook.FbCookie import com.pitchedapps.frost.facebook.FbItem -import com.pitchedapps.frost.facebook.USER_AGENT_BASIC +import com.pitchedapps.frost.facebook.USER_AGENT_DESKTOP import com.pitchedapps.frost.facebook.formattedFbUrl import com.pitchedapps.frost.utils.L import com.pitchedapps.frost.utils.Prefs @@ -32,7 +32,7 @@ import com.pitchedapps.frost.utils.isIndirectImageUrl import com.pitchedapps.frost.utils.isVideoUrl import com.pitchedapps.frost.utils.launchImageActivity import com.pitchedapps.frost.utils.launchWebOverlay -import com.pitchedapps.frost.utils.launchWebOverlayBasic +import com.pitchedapps.frost.utils.launchWebOverlayDesktop import com.pitchedapps.frost.views.FrostWebView /** @@ -76,15 +76,15 @@ fun FrostWebView.requestWebOverlay(url: String): Boolean { if (!Prefs.overlayEnabled) return false if (context is WebOverlayActivityBase) { L.v { "Check web request from overlay" } - val shouldUseBasic = url.formattedFbUrl.shouldUseBasicAgent + val shouldUseDesktop = url.formattedFbUrl.shouldUseDesktopAgent //already overlay; manage user agent - if (userAgentString != USER_AGENT_BASIC && shouldUseBasic) { - L.i { "Switch to basic agent overlay" } - context.launchWebOverlayBasic(url) + if (userAgentString != USER_AGENT_DESKTOP && shouldUseDesktop) { + L.i { "Switch to desktop agent overlay" } + context.launchWebOverlayDesktop(url) return true } - if (userAgentString == USER_AGENT_BASIC && !shouldUseBasic) { - L.i { "Switch from basic agent" } + if (userAgentString == USER_AGENT_DESKTOP && !shouldUseDesktop) { + L.i { "Switch from desktop agent" } context.launchWebOverlay(url) return true } @@ -103,9 +103,9 @@ val messageWhitelist: Set = setOf(FbItem.MESSAGES, FbItem.CHAT, FbItem.FEED_MOST_RECENT, FbItem.FEED_TOP_STORIES) .mapTo(mutableSetOf(), FbItem::url) -val String.shouldUseBasicAgent: Boolean +val String.shouldUseDesktopAgent: Boolean get() = when { - contains("story.php") -> false // do not use basic for comment section + contains("story.php") -> false // do not use desktop for comment section contains("/events/") -> false // do not use for events (namely the map) contains("/messages") -> true // must use for messages else -> false // default to normal user agent 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 1c300b03..c27385fc 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt @@ -35,7 +35,6 @@ import com.pitchedapps.frost.facebook.FB_USER_MATCHER import com.pitchedapps.frost.facebook.FbCookie import com.pitchedapps.frost.facebook.get import com.pitchedapps.frost.injectors.CssHider -import com.pitchedapps.frost.injectors.JsAssets import com.pitchedapps.frost.injectors.jsInject import com.pitchedapps.frost.utils.L import com.pitchedapps.frost.utils.Prefs diff --git a/docs/Changelog.md b/docs/Changelog.md index 78f796d6..7a6bbfab 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -2,6 +2,9 @@ ## v2.2.4 * Show top bar to allow sharing posts +* Fix unmuting videos when autoplay is enabled +* Add shortcut to toggle autoplay in settings > behaviour +* Update theme ## v2.2.3 * Add ability to hide stories @@ -9,6 +12,7 @@ * Apply notification keyword filter to title as well * Remove round icon settings as they are the default in Facebook * Update theme +* Update translations ## v2.2.2 * New marketplace shortcut -- cgit v1.2.3