Commit da30067b authored by MozLando's avatar MozLando
Browse files

Merge #7758



7758: Closes #7757: Add blob in default engine supported scheme r=Amejia481 a=rocketsroger
Co-authored-by: default avatarRoger Yang <royang@mozilla.com>
parents 89b67c76 e4092875
......@@ -252,7 +252,7 @@ class AppLinksUseCases(
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
// list of scheme from https://searchfox.org/mozilla-central/source/netwerk/build/components.conf
internal val ENGINE_SUPPORTED_SCHEMES: Set<String> = setOf("about", "data", "file", "ftp", "http",
"https", "moz-extension", "moz-safe-about", "resource", "view-source", "ws", "wss")
"https", "moz-extension", "moz-safe-about", "resource", "view-source", "ws", "wss", "blob")
internal val ALWAYS_DENY_SCHEMES: Set<String> = setOf("file", "javascript", "data", "about")
}
......
......@@ -49,6 +49,7 @@ class AppLinksUseCasesTest {
private val dataUrl = "data:text/plain;base64,SGVsbG8sIFdvcmxkIQ=="
private val aboutUrl = "about:config"
private val javascriptUrl = "javascript:'hello, world'"
private val blobUrl = "blob://example.com"
private val fileType = "audio/mpeg"
private val layerUrl = "https://exmaple.com"
private val layerPackage = "com.example.app"
......@@ -171,6 +172,15 @@ class AppLinksUseCasesTest {
assertFalse(redirect.isRedirect())
}
@Test
fun `A blob url is not an app link`() {
val context = createContext(Triple(blobUrl, appPackage, ""))
val subject = AppLinksUseCases(context, { true })
val redirect = subject.interceptedAppLinkRedirect(aboutUrl)
assertFalse(redirect.isRedirect())
}
@Test
fun `Will not redirect app link if browser option set to false and scheme is supported`() {
val context = createContext(Triple(appUrl, appPackage, ""))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment