Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Contributor
Posts: 3
Registered: ‎09-22-2010
My Device: Not Specified

Browser filter issue with URL pass through

I have an application which registers a browser filter.  On 4.6 OS (devices and simulators) and lower, if I try to pass the URL through the filter I get the following message:

 

       A problem occurred while trying to redner the page.

 

The very simplified code is below:

 

public class Protocol implements FilterBaseInterface {

    public Connection openFilter( String name, int mode, boolean timeouts ) throws IOException {       
        
        Connection connection = (HttpConnection)Connector.open("http:" + name + ";usefilter=false", mode, timeouts);
       
        return connection;
    }
}

 This works as expected (the page is rendered properly) for 5.0 devices and simulators.  However, the 4.x devices timeout (with exception "Local connection timed out after ~ 120000").

 

Shouldn't this work?

 

Thanks

 

New Contributor
Posts: 3
Registered: ‎09-22-2010
My Device: Not Specified

Re: Browser filter issue with URL pass through

BTW: I have also tried adding ";deviceside=true".

BlackBerry Development Advisor
Posts: 15,264
Registered: ‎07-09-2008
My Device: BlackBerry Passport
My Carrier: Bell

Re: Browser filter issue with URL pass through

[ Edited ]

Have you tried using the httpfilterdemo included with the BlackBerry Java SDK and BlackBerry JDE?  If so, are you seeing the same results with it?  Does this only affect real BlackBerry Smartphones or do you see the issue in the simulator as well?

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Contributor
Posts: 3
Registered: ‎09-22-2010
My Device: Not Specified

Re: Browser filter issue with URL pass through

Yes, the problem occurs with the following registration code:

 

 

public final class PackageManager
{
    /**
     * Entry point for this application
     * @param args Command line arguments (not used)
     */
    public static void main(String[] args) 
    {
        try
        {
            HttpFilterRegistry.registerFilter("my.url.com", "com.rim.samples.device.httpfilterdemo.filter", true);
        }
        catch(ControlledAccessException cae)
        {
            // Re-throw exception with explicit message
            throw new ControlledAccessException( cae + " Http Filter Demo attempted to access API governed by Interactions/Browser Filtering " +
                "application permission.  Please set this permission to 'allow' under Options/Security Options/Application Permissions");
        }
    }
}

 Note that the problem does not occur if isLocal (in registerFilter) is false.

 

Highlighted
Contributor
Posts: 10
Registered: ‎03-30-2010
My Device: Emulator
My Carrier: None

Re: Browser filter issue with URL pass through

I'm seeing this issue as well, and it's exacerbated by trying to run on 6.0, which seems to actually pay attention to the isLocal parameter. I'm in a situation where I can do one of three things:

1) set isLocal to false. This works on 4.x and 5.x devices, but prevents the filter from using network access and causes an "unable to connect to the internet" error if used on 6.0.

2) set isLocal to true. This works on 5.x and 6.0 devices but causes the "could not render" failure on 4.5 devices.

3) Check the software version. If it starts with "4.5" then isLocal gets set to false, otherwise it it is true. This works, but seems extremely hacky and hard to maintain.

Does anyone know if this is a known bug that was fixed in 5.x, or if there is a better way to get around it? If it is a bug that was fixed, knowing the version it got fixed in would be nice, as I could use that as the cutoff for my check instead of just guessing and using 4.5.

Developer
Posts: 54
Registered: ‎06-07-2010
My Device: 9780
My Carrier: sw

Re: Browser filter issue with URL pass through

hi, for simulator it is working fine , but in device 9800 not working, url opened.

how can i block in device also