may I ask how do you load your html source from local FS? Also, what does your MailCompose class do to interact with a document loaded in UIWebView?
If you read the contents of the html file in a line and then load it into a UIWebView, you need to modify it and load it using the file:// protocol.
Instead of loading the html source as a string:
NSString *html = [NSString stringWithContentsOfFile:[path stringByAppendingString:@"path to the html file"] encoding:NSUTF8StringEncoding error:NULL]; [webView loadHTMLString:html baseURL:baseURL];
Go and download the actual html file via NSURLRequest (file: // url)
NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:[path stringByAppendingString:@"path and file name of the file"]]; NSURLRequest *request = [NSURLRequest requestWithURL:baseURL]; [webView loadRequest:request];
By doing this, allows access to window.localStorage, window.openDatabase and other objects.
Greetings
source share