]> git.wh0rd.org - tt-rss.git/commitdiff
try to detect sanity check abnormalities (caused by Firebug)
authorAndrew Dolgov <fox@madoka.spb.ru>
Tue, 24 Apr 2007 03:28:10 +0000 (04:28 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Tue, 24 Apr 2007 03:28:10 +0000 (04:28 +0100)
errors.php
prefs.js
tt-rss.js

index c7499a9ce5595fad016a8b65b466523116136838..9fb028ecac9024e710d02f084dc9797545c615ac 100644 (file)
@@ -26,4 +26,7 @@
 
        $ERRORS[10] = __("Your version of MySQL is not currently supported. Please see 
                official site for more information.");
+
+       $ERRORS[11] = __("Sanity check request received twice. You could be running
+               Firebug or some other disrupting extension. Please turn it off.");
 ?>
index 60a7e1b17e08f401a318016cb36d23a46f5fe2e9..d61616182fad6e7c206ad0850fb066baf754a653 100644 (file)
--- a/prefs.js
+++ b/prefs.js
@@ -14,6 +14,8 @@ var init_params = new Array();
 
 var caller_subop = false;
 
+var sanity_check_done = false;
+
 function expand_feed_callback() {
        if (xmlhttp.readyState == 4) {
                try {   
@@ -1239,7 +1241,13 @@ function backend_sanity_check_callback() {
        if (xmlhttp.readyState == 4) {
 
                try {
-               
+
+                       if (sanity_check_done) {
+                               fatalError(11, "Sanity check request received twice. You could be running"+
+                             " Firebug or some other disrupting extension. Please turn it off.");
+                               return;
+                       }
+
                        if (!xmlhttp.responseXML) {
                                fatalError(3, "[D001, Received reply is not XML]: " + xmlhttp.responseText);
                                return;
@@ -1275,6 +1283,8 @@ function backend_sanity_check_callback() {
                                }
                        }
 
+                       sanity_check_done = true;
+
                        init_second_stage();
 
                } catch (e) {
index 2e884d587b555739f1adba31f0d6646ef023844b..c2e9d1cb7ad0a2352d776fa8470669b06dd27878 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -14,6 +14,7 @@ var cookie_lifetime = 0;
 var active_feed_id = 0;
 var active_feed_is_cat = false;
 var number_of_feeds = 0;
+var sanity_check_done = false;
 
 var xmlhttp = Ajax.getTransport();
 var xmlhttp_ctr = Ajax.getTransport();
@@ -88,7 +89,13 @@ function backend_sanity_check_callback() {
        if (xmlhttp.readyState == 4) {
 
                try {
-               
+       
+                       if (sanity_check_done) {
+                               fatalError(11, "Sanity check request received twice. You could be running"+
+                             " Firebug or some other disrupting extension. Please turn it off.");
+                               return;
+                       }
+
                        if (!xmlhttp.responseXML) {
                                fatalError(3, "[D001, Received reply is not XML]: " + xmlhttp.responseText);
                                return;
@@ -124,6 +131,8 @@ function backend_sanity_check_callback() {
                                }
                        }
 
+                       sanity_check_done = true;
+
                        init_second_stage();
 
                } catch (e) {