Commits:
-
8ada94b2
by Tara at 2025-03-03T10:09:21+01:00
Bug 1908488 - Improve dialogs. r=android-reviewers,gmalekpour, a=dmeehan [bp]
Differential Revision: https://phabricator.services.mozilla.com/D236606
-
ed4eb7c6
by John Schanck at 2025-03-03T10:09:22+01:00
Bug 1922357 - disallow the fido: URI scheme. a=dmeehan
Original Revision: https://phabricator.services.mozilla.com/D237313
Differential Revision: https://phabricator.services.mozilla.com/D238681
-
f53d7d49
by Jeff Boek at 2025-03-03T10:09:23+01:00
Bug 1928334 - Handles animating activities a=dmeehan
Original Revision: https://phabricator.services.mozilla.com/D238342
Differential Revision: https://phabricator.services.mozilla.com/D238845
-
bc8d56ec
by Tom Schuster at 2025-03-03T10:09:24+01:00
Bug 1942022 - Improve the about:protections CSP. r=firefox-desktop-core-reviewers ,mossop
Differential Revision: https://phabricator.services.mozilla.com/D234507
-
276610d2
by Tom Schuster at 2025-03-03T10:09:25+01:00
Bug 1942025 - Improve the about:privatebrowsing CSP. r=firefox-desktop-core-reviewers ,Gijs
Differential Revision: https://phabricator.services.mozilla.com/D234508
11 changed files:
Changes:
browser/components/privatebrowsing/content/aboutPrivateBrowsing.html
| ... |
... |
@@ -10,7 +10,7 @@ |
|
10
|
10
|
<meta charset="utf-8" />
|
|
11
|
11
|
<meta
|
|
12
|
12
|
http-equiv="Content-Security-Policy"
|
|
13
|
|
- content="default-src chrome: blob:; object-src 'none'"
|
|
|
13
|
+ content="default-src chrome:; img-src chrome: blob:; object-src 'none';"
|
|
14
|
14
|
/>
|
|
15
|
15
|
<meta name="color-scheme" content="light dark" />
|
|
16
|
16
|
<link rel="icon" href="">"chrome://browser/skin/privatebrowsing/favicon.svg" />
|
browser/components/protections/content/protections.html
| ... |
... |
@@ -8,7 +8,7 @@ |
|
8
|
8
|
<meta charset="utf-8" />
|
|
9
|
9
|
<meta
|
|
10
|
10
|
http-equiv="Content-Security-Policy"
|
|
11
|
|
- content="default-src chrome: blob:; object-src 'none'"
|
|
|
11
|
+ content="default-src chrome:; object-src 'none'"
|
|
12
|
12
|
/>
|
|
13
|
13
|
<meta name="color-scheme" content="light dark" />
|
|
14
|
14
|
<link rel="localization" href="">"branding/brand.ftl" />
|
mobile/android/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngineSession.kt
| ... |
... |
@@ -1818,7 +1818,7 @@ class GeckoEngineSession( |
|
1818
|
1818
|
internal const val ABOUT_BLANK = "about:blank"
|
|
1819
|
1819
|
internal const val JS_SCHEME = "_javascript_"
|
|
1820
|
1820
|
internal val BLOCKED_SCHEMES =
|
|
1821
|
|
- listOf("file", "resource", JS_SCHEME) // See 1684761 and 1684947
|
|
|
1821
|
+ listOf("file", "resource", "fido", JS_SCHEME) // See 1684761 and 1684947
|
|
1822
|
1822
|
|
|
1823
|
1823
|
/**
|
|
1824
|
1824
|
* Provides an ErrorType corresponding to the error code provided.
|
mobile/android/android-components/components/browser/engine-gecko/src/test/java/mozilla/components/browser/engine/gecko/GeckoEngineSessionTest.kt
| ... |
... |
@@ -631,6 +631,11 @@ class GeckoEngineSessionTest { |
|
631
|
631
|
engineSession.loadUrl("RESOURCE://package/test.text")
|
|
632
|
632
|
verify(geckoSession, never()).load(GeckoSession.Loader().uri("resource://package/test.text"))
|
|
633
|
633
|
verify(geckoSession, never()).load(GeckoSession.Loader().uri("RESOURCE://package/test.text"))
|
|
|
634
|
+
|
|
|
635
|
+ engineSession.loadUrl("fido:/12345678")
|
|
|
636
|
+ engineSession.loadUrl("FIDO:/12345678")
|
|
|
637
|
+ verify(geckoSession, never()).load(GeckoSession.Loader().uri("fido:/12345678"))
|
|
|
638
|
+ verify(geckoSession, never()).load(GeckoSession.Loader().uri("FIDO:/12345678"))
|
|
634
|
639
|
}
|
|
635
|
640
|
|
|
636
|
641
|
@Test
|
mobile/android/android-components/components/feature/app-links/src/main/java/mozilla/components/feature/app/links/AppLinksUseCases.kt
| ... |
... |
@@ -313,6 +313,7 @@ class AppLinksUseCases( |
|
313
|
313
|
"https", "moz-extension", "moz-safe-about", "resource", "view-source", "ws", "wss", "blob",
|
|
314
|
314
|
)
|
|
315
|
315
|
|
|
316
|
|
- internal val ALWAYS_DENY_SCHEMES: Set<String> = setOf("jar", "file", "_javascript_", "data", "about", "content")
|
|
|
316
|
+ internal val ALWAYS_DENY_SCHEMES: Set<String> =
|
|
|
317
|
+ setOf("jar", "file", "_javascript_", "data", "about", "content", "fido")
|
|
317
|
318
|
}
|
|
318
|
319
|
} |
mobile/android/android-components/components/feature/app-links/src/test/java/mozilla/components/feature/app/links/AppLinksUseCasesTest.kt
| ... |
... |
@@ -47,6 +47,7 @@ class AppLinksUseCasesTest { |
|
47
|
47
|
private val _javascript_Url = "_javascript_:'hello, world'"
|
|
48
|
48
|
private val jarUrl = "jar:file://some/path/test.html"
|
|
49
|
49
|
private val contentUrl = "content://media/external_primary/downloads/12345"
|
|
|
50
|
+ private val fidoPath = "fido:12345678"
|
|
50
|
51
|
private val fileType = "audio/mpeg"
|
|
51
|
52
|
private val layerUrl = "https://example.com"
|
|
52
|
53
|
private val layerPackage = "com.example.app"
|
| ... |
... |
@@ -215,6 +216,15 @@ class AppLinksUseCasesTest { |
|
215
|
216
|
assertFalse(redirect.isRedirect())
|
|
216
|
217
|
}
|
|
217
|
218
|
|
|
|
219
|
+ @Test
|
|
|
220
|
+ fun `A fido url is not an app link`() {
|
|
|
221
|
+ val context = createContext(Triple(fidoPath, appPackage, ""))
|
|
|
222
|
+ val subject = AppLinksUseCases(context, { true })
|
|
|
223
|
+
|
|
|
224
|
+ val redirect = subject.interceptedAppLinkRedirect(fidoPath)
|
|
|
225
|
+ assertFalse(redirect.isRedirect())
|
|
|
226
|
+ }
|
|
|
227
|
+
|
|
218
|
228
|
@Test
|
|
219
|
229
|
fun `Will not redirect app link if browser option set to false and scheme is supported`() {
|
|
220
|
230
|
val context = createContext(Triple(appUrl, appPackage, ""))
|
mobile/android/android-components/components/feature/prompts/src/main/java/mozilla/components/feature/prompts/PromptFeature.kt
| ... |
... |
@@ -9,6 +9,7 @@ import android.content.Intent |
|
9
|
9
|
import androidx.annotation.VisibleForTesting
|
|
10
|
10
|
import androidx.annotation.VisibleForTesting.Companion.PRIVATE
|
|
11
|
11
|
import androidx.core.view.isVisible
|
|
|
12
|
+import androidx.fragment.app.DialogFragment
|
|
12
|
13
|
import androidx.fragment.app.Fragment
|
|
13
|
14
|
import androidx.fragment.app.FragmentManager
|
|
14
|
15
|
import kotlinx.coroutines.CoroutineScope
|
| ... |
... |
@@ -1094,7 +1095,15 @@ class PromptFeature private constructor( |
|
1094
|
1095
|
emitPromptDismissedFact(promptName = promptRequest::class.simpleName.ifNullOrEmpty { "" })
|
|
1095
|
1096
|
}
|
|
1096
|
1097
|
|
|
|
1098
|
+ @VisibleForTesting
|
|
|
1099
|
+ internal fun redirectDialogFragmentIsActive() =
|
|
|
1100
|
+ (fragmentManager.findFragmentByTag("SHOULD_OPEN_APP_LINK_PROMPT_DIALOG") as? DialogFragment) != null
|
|
|
1101
|
+
|
|
1097
|
1102
|
private fun canShowThisPrompt(promptRequest: PromptRequest): Boolean {
|
|
|
1103
|
+ if (redirectDialogFragmentIsActive()) {
|
|
|
1104
|
+ return false
|
|
|
1105
|
+ }
|
|
|
1106
|
+
|
|
1098
|
1107
|
return when (promptRequest) {
|
|
1099
|
1108
|
is SingleChoice,
|
|
1100
|
1109
|
is MultipleChoice,
|
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/HomeActivity.kt
| ... |
... |
@@ -798,7 +798,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity { |
|
798
|
798
|
return false
|
|
799
|
799
|
}
|
|
800
|
800
|
|
|
801
|
|
- final override fun dispatchTouchEvent(ev: MotionEvent?): Boolean {
|
|
|
801
|
+ override fun dispatchTouchEvent(ev: MotionEvent?): Boolean {
|
|
802
|
802
|
ProfilerMarkers.addForDispatchTouchEvent(components.core.engine.profiler, ev)
|
|
803
|
803
|
return super.dispatchTouchEvent(ev)
|
|
804
|
804
|
}
|
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/customtabs/ExternalAppBrowserActivity.kt
| ... |
... |
@@ -7,6 +7,7 @@ package org.mozilla.fenix.customtabs |
|
7
|
7
|
import android.app.assist.AssistContent
|
|
8
|
8
|
import android.net.Uri
|
|
9
|
9
|
import android.os.Build
|
|
|
10
|
+import android.view.MotionEvent
|
|
10
|
11
|
import androidx.annotation.RequiresApi
|
|
11
|
12
|
import androidx.annotation.VisibleForTesting
|
|
12
|
13
|
import mozilla.components.browser.state.selector.findCustomTab
|
| ... |
... |
@@ -24,6 +25,8 @@ const val EXTRA_IS_SANDBOX_CUSTOM_TAB = "org.mozilla.fenix.customtabs.EXTRA_IS_S |
|
24
|
25
|
*/
|
|
25
|
26
|
@Suppress("TooManyFunctions")
|
|
26
|
27
|
open class ExternalAppBrowserActivity : HomeActivity() {
|
|
|
28
|
+ var isFinishedAnimating = false
|
|
|
29
|
+
|
|
27
|
30
|
override fun onResume() {
|
|
28
|
31
|
super.onResume()
|
|
29
|
32
|
|
| ... |
... |
@@ -74,4 +77,17 @@ open class ExternalAppBrowserActivity : HomeActivity() { |
|
74
|
77
|
val currentTabUrl = getExternalTab()?.content?.url
|
|
75
|
78
|
outContent?.webUri = currentTabUrl?.let { Uri.parse(it) }
|
|
76
|
79
|
}
|
|
|
80
|
+
|
|
|
81
|
+ override fun dispatchTouchEvent(ev: MotionEvent?): Boolean {
|
|
|
82
|
+ if (!isFinishedAnimating) {
|
|
|
83
|
+ return true
|
|
|
84
|
+ }
|
|
|
85
|
+
|
|
|
86
|
+ return super.dispatchTouchEvent(ev)
|
|
|
87
|
+ }
|
|
|
88
|
+
|
|
|
89
|
+ override fun onEnterAnimationComplete() {
|
|
|
90
|
+ super.onEnterAnimationComplete()
|
|
|
91
|
+ isFinishedAnimating = true
|
|
|
92
|
+ }
|
|
77
|
93
|
} |
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/IntentUtils.java
| ... |
... |
@@ -76,6 +76,10 @@ public class IntentUtils { |
|
76
|
76
|
return getSafeIntent(aUri) != null;
|
|
77
|
77
|
}
|
|
78
|
78
|
|
|
|
79
|
+ if ("fido".equals(scheme)) {
|
|
|
80
|
+ return false;
|
|
|
81
|
+ }
|
|
|
82
|
+
|
|
79
|
83
|
return true;
|
|
80
|
84
|
}
|
|
81
|
85
|
|
mobile/android/geckoview/src/test/java/org/mozilla/gecko/util/IntentUtilsTest.java
| ... |
... |
@@ -63,4 +63,10 @@ public class IntentUtilsTest { |
|
63
|
63
|
final String uri = "intent:non_scheme_intent#Intent;end";
|
|
64
|
64
|
assertTrue(IntentUtils.isUriSafeForScheme(uri));
|
|
65
|
65
|
}
|
|
|
66
|
+
|
|
|
67
|
+ @Test
|
|
|
68
|
+ public void unsafeFidoUri() {
|
|
|
69
|
+ final String uri = "fido:/12345678";
|
|
|
70
|
+ assertFalse(IntentUtils.isUriSafeForScheme(uri));
|
|
|
71
|
+ }
|
|
66
|
72
|
} |
|