[ 
https://issues.apache.org/jira/browse/CB-9334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14629501#comment-14629501
 ] 

ASF GitHub Bot commented on CB-9334:
------------------------------------

Github user spirann commented on a diff in the pull request:

    https://github.com/apache/cordova-android/pull/195#discussion_r34771734
  
    --- Diff: framework/src/org/apache/cordova/PluginManager.java ---
    @@ -381,15 +374,16 @@ public void onReset() {
         }
     
         Uri remapUri(Uri uri) {
    +        Uri remap = uri;
             for (CordovaPlugin plugin : this.pluginMap.values()) {
                 if (plugin != null) {
    -                Uri ret = plugin.remapUri(uri);
    +                Uri ret = plugin.remapUri(remap);
                     if (ret != null) {
    -                    return ret;
    +                    remap = ret;
                     }
                 }
             }
    -        return null;
    +        return uri.equals(remap) ? null : remap;
    --- End diff --
    
    It was the default behavior to return null if no plugins ends up remapping 
the uri. The only change is that it also return null if a plugin remap the uri 
to the same uri, because there's no need to act like there's a change when 
there's not (some plugins like JsHybuggerPlugin for example always remap every 
uri, to the same when no action is needed)


> PluginManager permit only one plugin to remap the URI
> -----------------------------------------------------
>
>                 Key: CB-9334
>                 URL: https://issues.apache.org/jira/browse/CB-9334
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 3.7.1
>            Reporter: Simon Pireyn
>              Labels: android, plugins
>
> If a plugin return an URI and not null, the plugin manager stop calling 
> remapUri and use the value returned. It doesn't allow another plugin to check 
> or remap the URI
> ex: JsHybuggerPlugin gets all URL to eventually add 
> "content://jsHybugger.org/" before every url.
> Or if I need with one plugin to replace "myserver://" with "http://myserver"; 
> and in another to replace {placeholders} or watherver.
> PluginManager should loop every plugins before returning the remapped URI.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to