filtering by MIME Type in WebView
filtering by MIME Type in WebView
- Subject: filtering by MIME Type in WebView
- From: "Josh Ferguson" <email@hidden>
- Date: Sat, 26 Mar 2005 13:05:33 -0600
- Thread-topic: filtering by MIME Type in WebView
I’m trying to create a WebView that filters
its contents based on MIME Type. I don’t want it to load video/audio
elements and I don’t want to load anything requiring an outside app
(.PDF, for example). I thought I’d found the answer in the webView:decidePolicyForMIMEType:request:frame:decisionListener:
delegate method. My delegate method looks something like this:
- (void)webView:(WebView
*)sender decidePolicyForMIMEType:(NSString *)type request:(NSURLRequest *)request frame:(WebFrame
*)frame decisionListener:(id<WebPolicyDecisionListener>)listener {
If([type hasPrefix:@”application”]
|| [type hasPrefix:@”audio”] || [type hasPrefix:@”video”)
[listener
ignore];
else
[listener
use];
}
However, every time this delegate is called, the
type is ALWAYS text/html. Am I misunderstanding the purpose of this method, or
is there a better way to accomplish what I’m looking for? Thanks in
advance.
Josh Ferguson
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden