| | 238 | - (void) removeScriptGlobalsForWebView:(WebView *) webView { |
|---|
| | 239 | if (!webView) |
|---|
| | 240 | return; |
|---|
| | 241 | |
|---|
| | 242 | [[webView windowScriptObject] removeWebScriptKey:@"Plugin"]; |
|---|
| | 243 | [[webView windowScriptObject] removeWebScriptKey:@"ChatController"]; |
|---|
| | 244 | [[webView windowScriptObject] removeWebScriptKey:@"ConnectionsController"]; |
|---|
| | 245 | [[webView windowScriptObject] removeWebScriptKey:@"FileTransferController"]; |
|---|
| | 246 | [[webView windowScriptObject] removeWebScriptKey:@"BuddyListController"]; |
|---|
| | 247 | [[webView windowScriptObject] removeWebScriptKey:@"SpeechController"]; |
|---|
| | 248 | [[webView windowScriptObject] removeWebScriptKey:@"NotificationController"]; |
|---|
| | 249 | [[webView windowScriptObject] removeWebScriptKey:@"ChatPluginManager"]; |
|---|
| | 250 | } |
|---|
| | 251 | |
|---|
| 259 | | id old = _webview; |
|---|
| 260 | | _webview = [[WebView allocWithZone:nil] initWithFrame:NSZeroRect]; |
|---|
| 261 | | [old release]; |
|---|
| 262 | | |
|---|
| 263 | | [_webview setPolicyDelegate:self]; |
|---|
| 264 | | [_webview setFrameLoadDelegate:self]; |
|---|
| 265 | | [_webview setUIDelegate:self]; |
|---|
| 266 | | if( [_webview respondsToSelector:@selector( setScriptDebugDelegate: )] ) |
|---|
| 267 | | [_webview setScriptDebugDelegate:self]; |
|---|
| | 273 | if (!_webview) { |
|---|
| | 274 | _webview = [[WebView allocWithZone:nil] initWithFrame:NSZeroRect]; |
|---|
| | 275 | |
|---|
| | 276 | [_webview setPolicyDelegate:self]; |
|---|
| | 277 | [_webview setFrameLoadDelegate:self]; |
|---|
| | 278 | [_webview setUIDelegate:self]; |
|---|
| | 279 | if( [_webview respondsToSelector:@selector( setScriptDebugDelegate: )] ) |
|---|
| | 280 | [_webview setScriptDebugDelegate:self]; |
|---|
| | 281 | } else { |
|---|
| | 282 | [self removeScriptGlobalsForWebView:_webview]; |
|---|
| | 283 | } |
|---|