Detect if file should be loaded from UIWebview

My goal is to detect audio files (mp3, mp4, m4a and wav) by clicking a link in UIWebview. I have a delegate call

-(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType

      

and it checks if the URL extension ends in one of the specified extensions. The problem is I am trying to download files from sites like mail.google.com and mail.yahoo.com, as well as others that do not use direct links.

Is there a general way to get the file type by clicking any link, or do you need to do this based on the site. I am a newbie when it comes to html / javascript coding. Thanks for your help.

+3


source to share


1 answer


Sorry, I didn't see this link at first, but it has everything I need to solve this problem.



? check the answer while webView: shouldStartLoadWithRequest: naviagiontType ... is waiting?

0


source







All Articles