adium/adium

Parents 3cd596256677
Children
Add a short delay to the contentAdded event, to ensure it's run after the content has been appended.
--- a/Plugins/WebKit Message View/AIWebKitMessageViewController.m Tue Apr 16 20:33:19 2013 +0200
+++ b/Plugins/WebKit Message View/AIWebKitMessageViewController.m Tue Apr 16 22:33:54 2013 +0200
@@ -656,9 +656,11 @@
if (objectsAdded > 0) {
[webView stringByEvaluatingJavaScriptFromString:
- @"var evt = document.createEvent(\"Event\");\n"
+ @"window.setTimeout(function () {\n"
+ @"var evt = document.createEvent(\"Event\");\n"
@"evt.initEvent(\"contentAdded\", true, true);\n"
- @"document.dispatchEvent(evt);"];
+ @"document.dispatchEvent(evt);"
+ @"}, 100);"];
}
//If there is still content to process (the webview wasn't ready), we'll try again after a brief delay