diff options
Diffstat (limited to 'Source/SPBundleHTMLOutputController.m')
-rw-r--r-- | Source/SPBundleHTMLOutputController.m | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/Source/SPBundleHTMLOutputController.m b/Source/SPBundleHTMLOutputController.m index 6e5ffedd..1995cfcb 100644 --- a/Source/SPBundleHTMLOutputController.m +++ b/Source/SPBundleHTMLOutputController.m @@ -29,13 +29,28 @@ @class WebScriptCallFrame; +#pragma mark - + +@interface WebView (WebViewPrivate) +- (void) setScriptDebugDelegate:(id) delegate; +@end + +@interface WebScriptCallFrame : NSObject +- (id)userInfo; +- (WebScriptCallFrame *)caller; +- (NSString *)functionName; +- (id)exception; +@end + +#pragma mark - + @implementation SPBundleHTMLOutputController @synthesize docTitle; @synthesize initHTMLSourceString; @synthesize windowUUID; @synthesize docUUID; -@synthesize suppressExceptionAlert; +@synthesize suppressExceptionAlerting; /** * Initialisation @@ -52,8 +67,10 @@ [webView setDrawsBackground:YES]; [webView setEditable:NO]; [webView setShouldCloseWithWindow:YES]; +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 [webView setShouldUpdateWhileOffscreen:NO]; - suppressExceptionAlert = NO; +#endif + suppressExceptionAlerting = NO; } @@ -311,7 +328,7 @@ [newWebView showWindows]; } -- (void)webView:(WebView *)webView decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id<WebPolicyDecisionListener>)listener +- (void)webView:(WebView *)aWebView decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id<WebPolicyDecisionListener>)listener { NSInteger navigationType = [[actionInformation objectForKey:WebActionNavigationTypeKey] integerValue]; @@ -335,11 +352,11 @@ switch(navigationType) { case WebNavigationTypeLinkClicked: - [[webView mainFrame] loadRequest:request]; + [[aWebView mainFrame] loadRequest:request]; [listener use]; break; case WebNavigationTypeReload: - [[webView mainFrame] loadHTMLString:[self initHTMLSourceString] baseURL:nil]; + [[aWebView mainFrame] loadHTMLString:[self initHTMLSourceString] baseURL:nil]; break; default: [listener use]; @@ -506,7 +523,7 @@ NSString *mes = [NSString stringWithFormat:@"Exception:\nline = %ld\nfunction = %@\ncaller = %@\nexception = %@", lineno, [frame functionName], [frame caller], [frame userInfo], [frame exception]]; - if([self suppressExceptionAlert]) { + if([self suppressExceptionAlerting]) { NSLog(@"%@", mes); return; } @@ -599,7 +616,7 @@ */ - (void)suppressExceptionAlert { - [self setSuppressExceptionAlert:YES]; + [self setSuppressExceptionAlerting:YES]; } /** |