Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you added (<a href="https://github.com/purplecabbage/phonegap-plugins/tree/master/iPhone/ChildBrowser" rel="noreferrer">Child Browser</a>) plugin classes in plugin folder then you have to play with the appDelegate.m file, <code>#import "ChildBrowserViewController.h"</code><br/> For example your html file has following html/javascript code, like this<br/> <code>window.location="http://xyz.com/magazines/magazines101.pdf";</code><br/> To execute this url in Child Browser, you need to modify native <code>shouldStartLoadWithRequest:</code> method for request url which contain pdf extension files.</p> <pre><code> /** * Start Loading Request * This is where most of the magic happens... We take the request(s) and process the response. * From here we can re direct links and other protocalls to different internal methods. */ - (BOOL)webView:(UIWebView *)theWebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { //return [ super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType ]; NSURL *url = [request URL]; if([request.URL.absoluteString isEqualToString:@"about:blank"]) return [ super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType ]; if ([[url scheme] isEqualToString:@"gap"]) { return [ super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType ]; } else { NSString *urlFormat = [[[url path] componentsSeparatedByString:@"."] lastObject]; if ([urlFormat compare:@"pdf"] == NSOrderedSame) { [theWebView sizeToFit]; //This code will open pdf extension files (url's) in Child Browser ChildBrowserViewController* childBrowser = [ [ ChildBrowserViewController alloc ] initWithScale:FALSE ]; childBrowser.modalPresentationStyle = UIModalPresentationFormSheet; childBrowser.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; [super.viewController presentModalViewController:childBrowser animated:YES ]; NSString* urlString=[NSString stringWithFormat:@"%@",[url absoluteString]]; [childBrowser loadURL:urlString]; [childBrowser release]; return NO; } else return [ super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType ]; } } </code></pre> <p>thanks,<br/> Mayur</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload