• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
filtering by MIME Type in WebView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: filtering by MIME Type in WebView
      • From: Ricky Sharp <email@hidden>
  • Prev by Date: Re: Odd parse error when I try to build
  • Next by Date: absolutePathForAppBundleWithIdentifier:(returns nil)
  • Previous by thread: Re: Odd parse error when I try to build
  • Next by thread: Re: filtering by MIME Type in WebView
  • Index(es):
    • Date
    • Thread