if (gmailapi == null) setTimeout(arguments.callee, 0);
I've attached a patch to stop trying after 10 seconds.
Ed
# HG changeset patch
# User Edward Lee <edwar...@engineering.uiuc.edu>
# Date 1225665277 21600
# Node ID 14ba2fec441cc7d1e1abffe3f7f15644247f3976
# Parent 091fb3f6a3950923c0b02ccd7a98678ad6752deb
Avoid high cpu infinite loop by stopping after 10 seconds
diff --git a/modified_gmail_macros_v_.user.js b/modified_gmail_macros_v_.user.js
--- a/modified_gmail_macros_v_.user.js
+++ b/modified_gmail_macros_v_.user.js
@@ -11,12 +11,15 @@
var scriptVersion=20081021.1;
window.addEventListener('load', function() {
+ // Keep trying to load in this frame for 10 seconds
+ var tryLoad = true;
+ setTimeout(function() { tryLoad = false; }, 10000);
+
(function(){
var gmailapi = typeof unsafeWindow != "undefined" &&
unsafeWindow.gmonkey
|| (frames.js ? frames.js.gmonkey : null);
if (gmailapi == null) {
- setTimeout(arguments.callee, 0);
- return;
+ return tryLoad ? setTimeout(arguments.callee, 0) : 0;
}
gmailapi.load('1.0', init);
})();
--
Ed