0

I used to disable js alert in UIWebView by overriding

- (void)webView:(UIWebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame;

as mentioned by this answer.

Now with ios7&xcode5, the above code has the compile error: WebFrame: expected a type

There is no WebFrame anymore? Anyone know about this?

Community
  • 1
  • 1
smilingpoplar
  • 1,065
  • 1
  • 15
  • 26
  • The `webview:runJavaScriptAlertPanelWithMessage:initiatedByFrame:` is a private method. Apple might have changed this in iOS 7. Thus you going to have to find an other way to do this. – rckoenes Sep 17 '13 at 13:28
  • 1
    Well, it is not in the official header of `UIWebView` nor is it in any delegate. That would make it a private method, Apple might reject you for using it. I was available in OSX but never on iOS – rckoenes Sep 17 '13 at 13:33
  • @rckoenes have a look at the documentation https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Webkit/Protocols/WebUIDelegate_Protocol/Reference/Reference.html it is a delegate. I used it before. But now it looks like it doesn't work anymore. – Alex Cio Sep 26 '13 at 09:49
  • That is the OSX reference and **not** the iOS reference of [UIWebView](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIWebView_Class/Reference/Reference.html) – rckoenes Sep 26 '13 at 09:59

1 Answers1

1

Change WebFrame * to id or import the header from webkit.

wtl
  • 312
  • 3
  • 13