Commit e4092875 authored by Roger Yang's avatar Roger Yang
Browse files

Closes #7757: Add blob in default engine supported scheme

parent 89b67c76
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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")
    }
+10 −0
Original line number Diff line number Diff line
@@ -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, ""))