cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agrieve <...@git.apache.org>
Subject [GitHub] cordova-android pull request: Unplug whitelist
Date Wed, 29 Oct 2014 14:25:48 GMT
Github user agrieve commented on a diff in the pull request:

    https://github.com/apache/cordova-android/pull/132#discussion_r19540574
  
    --- Diff: framework/src/org/apache/cordova/CordovaUriHelper.java ---
    @@ -37,11 +38,54 @@ public CordovaUriHelper(CordovaInterface cdv, CordovaWebView webView)
             appView = webView;
             cordova = cdv;
         }
    -    
    +
    +    /**
    +     * Determine whether the webview should be allowed to navigate to a given URL.
    +     *
    +     * This method implements the default whitelist policy when no plugins override
    +     * shouldAllowNavigation
    +     */
    +    public boolean shouldAllowNavigation(String url) {
    +        Boolean pluginManagerAllowsNavigation = this.appView.getPluginManager().shouldAllowNavigation(url);
    +        if (pluginManagerAllowsNavigation == null) {
    +            // Default policy:
    +            // Internal urls on file:// or data:// that do not contain "app_webview"
are allowed for navigation
    +            if(url.startsWith("file://") || url.startsWith("data:"))
    +            {
    +                //This directory on WebKit/Blink based webviews contains SQLite databases!
    +                //DON'T CHANGE THIS UNLESS YOU KNOW WHAT YOU'RE DOING!
    +                return !url.contains("app_webview");
    --- End diff --
    
    We should change this to at least be: "/app_webview/"


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Mime
View raw message