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

Adobe AIR Development

Reply
New Contributor
nishantkyal
Posts: 3
Registered: ‎03-29-2011
My Device: Blackberry Playbook
My Carrier: Airtel

NetworkResourceHeaderReceivedEvent in QNXStageWebView

Hi,

 

I'm trying to get the headers for the request. But I can neither find the enableResourceFiltering in QNXStageWebView neither NetworkResourceHeaderReceivedEvent class so I can include it.

 

Any clues?

Please use plain text.
Contributor
kmbauer
Posts: 47
Registered: ‎06-27-2010
My Device: Bold 9700
My Carrier: AT&T

Re: NetworkResourceHeaderReceivedEvent in QNXStageWebView

I am also interested in sniffing the headers of an embedded QNXStageWebView.  Any ideas on how to do this?

Please use plain text.
Contributor
kmbauer
Posts: 47
Registered: ‎06-27-2010
My Device: Bold 9700
My Carrier: AT&T

Re: NetworkResourceHeaderReceivedEvent in QNXStageWebView

Looks like I got it.

 On your QNXStageWebView add listeners...

 

//Listen for all requests made so you can decide to listen for headers

mySwv.addEventListener(NetworkResourceRequestedEvent.NETWORK_RESOURCE_REQUESTED, handleNetworkResourceRequested);           

//Listen for headers on requests that look importatnt

mySwv.addEventListener(NetworkResourceHeaderReceivedEvent.NETWORK_RESOURCE_HEADER_RECEIVED, handleNetworkResourceHeaderReceived);

Create a method  "handleNetworkResourceRequested" that can listen for all requests and detirmine if you should keep filtering for more info.

 private function handleNetworkResourceRequested(e:NetworkResourceRequestedEvent):void         {   

            .....

            //Once you have determined that this is a worthy request set the action to filter (otherwise your other listener will not get called)

            e.action = NetworkResourceRequestedEvent.ACTION_FILTER; 




//Now in your second menu you can listen for headers on the flaged requests...
private function handleNetworkResourceHeaderReceived(e:NetworkResourceHeaderReceivedEvent):void         {           statusLabel.text = e.key + " = " + e.headerValue;         

} 

Please use plain text.