Bug 1480757 - [4.0] Emit load error when blocking load requests for unsafe URIs. r=snorp
authorEugen Sawin <esawin@mozilla.com>
Mon, 06 Aug 2018 23:57:42 +0200
changeset 485936 0e7fa66a761c242203eddb68a3f713ada4a1a8a5
parent 485935 9e1dfd6ceee22640b124c312cb8bda4e916d3e09
child 485937 43fd4a3dbdc7bdc9e5bcc1a30e71ffee0d85545c
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1480757
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1480757 - [4.0] Emit load error when blocking load requests for unsafe URIs. r=snorp
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
@@ -301,16 +301,21 @@ public class GeckoSession extends LayerS
                                             message.getBoolean("canGoForward"));
                 } else if ("GeckoView:OnLoadRequest".equals(event)) {
                     final String uri = message.getString("uri");
                     final int where = convertGeckoTarget(message.getInt("where"));
                     final int flags = filterFlags(message.getInt("flags"));
 
                     if (!IntentUtils.isUriSafeForScheme(uri)) {
                         callback.sendError("Blocked unsafe intent URI");
+
+                        delegate.onLoadError(GeckoSession.this, uri,
+                                             NavigationDelegate.ERROR_CATEGORY_URI,
+                                             NavigationDelegate.ERROR_MALFORMED_URI);
+
                         return;
                     }
 
                     final GeckoResult<Boolean> result =
                         delegate.onLoadRequest(GeckoSession.this, uri, where, flags);
 
                     if (result == null) {
                         callback.sendSuccess(null);