cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Filip Maj (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CB-4024) About url-filter Feature
Date Wed, 03 Jul 2013 19:02:20 GMT

     [ https://issues.apache.org/jira/browse/CB-4024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Filip Maj updated CB-4024:
--------------------------

    Component/s:     (was: Plugman)
    
> About url-filter Feature
> ------------------------
>
>                 Key: CB-4024
>                 URL: https://issues.apache.org/jira/browse/CB-4024
>             Project: Apache Cordova
>          Issue Type: Wish
>          Components: Android
>    Affects Versions: 2.8.0
>            Reporter: 胡争辉
>            Assignee: Joe Bowser
>            Priority: Trivial
>
> I noticed there is a comment in framework/src/org/apache/cordova/api/PluginManager.java
Line 131 :
> // What is this?
> https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;a=blob;f=framework/src/org/apache/cordova/api/PluginManager.java;h=0a42b3abd2fc9c684728dbbdeb0cc62cd335c2b3;hb=HEAD#l131
> So I review the relative code. After a few hour, I find this code works:
> In config.xml
>     <feature name="UrlFilter">
>         <param name="android-package" value="com.daonao.test4.UrlFilter"/>
>         <url-filter value="file:///android_asset/www/"/>
>     </feature>
> In class com.daonao.test4.UrlFilter
> @Override
> @TargetApi(Build.VERSION_CODES.HONEYCOMB)
> public WebResourceResponse shouldInterceptRequest(String url) {
> ByteArrayInputStream stream = new ByteArrayInputStream(url.getBytes());
> return new WebResourceResponse("text/plain", "UTF-8", stream);
> }
> I am not sure these code is the right way, but it works now for me.
> For your information.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message