-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
In using this library I have noticed that the functionality breaks when reloading a page or navigating to a new page.
_webView.delegate = self;
javaScriptInterface* interface = [javaScriptInterface new];
[self.webView addJavascriptInterfaces:interface WithName:@"interface"];
interface.webView = self;
[interface release];
[[NSURLCache sharedURLCache] removeAllCachedResponses];
[_webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"mywebpage.com"]]];
This is the code I use for an initial load of the page. If I call another loadrequest on the same webview the communication between javascript and obj-c stops working. I am working with a web page that is designed to make a lot of calls to these interface functions, and without them the webpage is broken.
This also doesn't work if I try to add a new interface before reloading.
Is there any work around or fix to this? At the moment I am creating a new webview everytime I need to reload and destroying the old one, but would like to use one webview for everything.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels