Reputation: 3588
UIWebView
on iOS 10.x Simulator
which is working great. Now i am trying to loading same web page in WKWebView
like this -
@interface ViewController2 ()
@property(strong,nonatomic) WKWebView *webView;
@property (strong, nonatomic) NSString *productURL;
@end
@implementation ViewController2
- (void)viewDidLoad
{
[super viewDidLoad];
self.productURL = @"http://192.168.1.157/rockwellApp_v2/?city=719";
NSURL *url = [NSURL URLWithString:self.productURL];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
_webView = [[WKWebView alloc] initWithFrame:self.view.frame];
[_webView loadRequest:request];
_webView.frame = CGRectMake(self.view.frame.origin.x,self.view.frame.origin.y, self.view.frame.size.width, self.view.frame.size.height);
[self.view addSubview:_webView];
}
@end
but failed to load complete web page.
When i am debugging the WKWebView in WebKit Nightly,It gives me error in console like SecurityError (DOM Exception 18): The operation is insecure.
Upvotes: 0
Views: 3876
Reputation: 126
Calling window.history.pushState()
with invalid or insecure parameters will trigger the exception: SecurityError (DOM Exception 18): The operation is insecure.
A script in the page you loaded is most likely trying to push some history that uses a hardcoded domain or scheme (ex. http://example.com
) which does not match with your current domain http://192.168.1.157
.
An uncaught exception will prevent the rest of the script to evaluate. Thats why it does not load/render fully.
To debug this issue, add exception breakpoints in the web inspector and refresh the page by pressing cmd
+ r
with the web debugger as the selected window.
Upvotes: 1