Skip to content

UIWebView evaluateJavaScript causes access violation executing location exception #2775

Open

Description

Hi.

Brief steps to reproduce the issue:

  1. Load html page using loadHtmlString.
  2. Call evaluateJavaScript with [NSString stringWithFormat:@"window.location.href"] parameter.

For instance:

- (void)webViewDidFinishLoad:(UIWebView *)webView {
        // the line below will cause exception
         [self.webView evaluateJavaScript:[NSString stringWithFormat:@"window.location.href"] completionHandler:^(id result, NSError *error) {
                NSLog(@"finish: %@", result);
        }];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions