Loading components/feature/app-links/src/main/java/mozilla/components/feature/app/links/AppLinksUseCases.kt +1 −1 Original line number Diff line number Diff line Loading @@ -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") } Loading components/feature/app-links/src/test/java/mozilla/components/feature/app/links/AppLinksUseCasesTest.kt +10 −0 Original line number Diff line number Diff line Loading @@ -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" Loading Loading @@ -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, "")) Loading Loading
components/feature/app-links/src/main/java/mozilla/components/feature/app/links/AppLinksUseCases.kt +1 −1 Original line number Diff line number Diff line Loading @@ -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") } Loading
components/feature/app-links/src/test/java/mozilla/components/feature/app/links/AppLinksUseCasesTest.kt +10 −0 Original line number Diff line number Diff line Loading @@ -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" Loading Loading @@ -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, "")) Loading