Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c18ede1 authored by Ben Murdoch's avatar Ben Murdoch
Browse files

Do not allow file:// access when it is disabled.

If WebSettings is configured to disallow access to file://
URLs, then block them.

Bug: 5773763
Change-Id: If2793f31cb37e0d3af15cb18e818bfa4058167fd
parent 92363543
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -942,6 +942,13 @@ class BrowserFrame extends Handler {
        if (androidResource != null) {
            return new WebResourceResponse(null, null, androidResource);
        }

        // Note that we check this after looking for an android_asset or
        // android_res URL, as we allow those even if file access is disabled.
        if (!mSettings.getAllowFileAccess() && url.startsWith("file://")) {
            return new WebResourceResponse(null, null, null);
        }

        WebResourceResponse response = mCallbackProxy.shouldInterceptRequest(url);
        if (response == null && "browser:incognito".equals(url)) {
            try {