[Pkg-mozext-commits] [firebug] 16/22: Add a hack for issue 7401 (Debugger causes second request on POST)

David Prévot taffit at moszumanska.debian.org
Sat Jul 19 21:45:52 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository firebug.

commit cb64ab360dd72aabdcedbe10c33e3e8b13d8cbe9
Author: Simon Lindholm <simon.lindholm10 at gmail.com>
Date:   Tue Jul 1 03:40:18 2014 +0200

    Add a hack for issue 7401 (Debugger causes second request on POST)
    
    https://code.google.com/p/fbug/issues/detail?id=7401
---
 .../content/firebug/debugger/script/sourceFile.js   | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/extension/content/firebug/debugger/script/sourceFile.js b/extension/content/firebug/debugger/script/sourceFile.js
index 7da819f..75bbec4 100644
--- a/extension/content/firebug/debugger/script/sourceFile.js
+++ b/extension/content/firebug/debugger/script/sourceFile.js
@@ -140,8 +140,27 @@ SourceFile.prototype =
         }
 
         // This is the only place where source (the text) is loaded for specific URL.
+        // To avoid double POSTs or missing cookies we use sourceCache for the top
+        // window load (issue 7401).
         var sourceClient = threadClient.source(this);
-        sourceClient.source(this.onSourceLoaded.bind(this));
+        var sourceCache = this.context.sourceCache;
+        var url = this.href;
+        if (url === this.context.window.location.href &&
+            sourceCache.isCached(sourceCache.removeAnchor(url)))
+        {
+            // Use a timeout to call onSourceLoaded asynchronously, otherwise
+            // syntax highlighing breaks somehow.
+            setTimeout(() => {
+                this.onSourceLoaded({
+                    source: sourceCache.loadText(url),
+                    contentType: "text/html",
+                });
+            });
+        }
+        else
+        {
+            sourceClient.source(this.onSourceLoaded.bind(this));
+        }
     },
 
     // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firebug.git



More information about the Pkg-mozext-commits mailing list