[or-cvs] r19072: {torbutton} Bug 866: Fix Zotero conflict. (torbutton/trunk/src/chrome/content)
mikeperry at seul.org
mikeperry at seul.org
Wed Mar 18 04:14:33 UTC 2009
Author: mikeperry
Date: 2009-03-18 00:14:30 -0400 (Wed, 18 Mar 2009)
New Revision: 19072
Modified:
torbutton/trunk/src/chrome/content/torbutton.js
Log:
Bug 866: Fix Zotero conflict.
Modified: torbutton/trunk/src/chrome/content/torbutton.js
===================================================================
--- torbutton/trunk/src/chrome/content/torbutton.js 2009-03-18 02:39:21 UTC (rev 19071)
+++ torbutton/trunk/src/chrome/content/torbutton.js 2009-03-18 04:14:30 UTC (rev 19072)
@@ -2209,7 +2209,7 @@
if (topic == "http-on-examine-response") {
torbutton_eclog(3, 'Definitaly Examine response: '+subject.name);
- torbutton_check_progress(null, subject);
+ torbutton_check_progress(null, subject, 0);
} else if (topic == "http-on-modify-request") {
torbutton_eclog(3, 'Modify request: '+subject.name);
}
@@ -2799,13 +2799,27 @@
// of its being called so early. Need to find a quick way to check if
// aProgress and aRequest are actually fully initialized
// (without throwing exceptions)
-function torbutton_check_progress(aProgress, aRequest) {
+function torbutton_check_progress(aProgress, aRequest, aFlags) {
if (!m_tb_wasinited) {
torbutton_init();
}
var DOMWindow = null;
+ // Bug #866: Zotero conflict with about:blank windows
+ // handle docshell JS switching and other early duties
+ var WP_STATE_START = Ci.nsIWebProgressListener.STATE_START;
+ var WP_STATE_DOC = Ci.nsIWebProgressListener.STATE_IS_DOCUMENT;
+ var WP_STATE_START_DOC = WP_STATE_START | WP_STATE_DOC;
+
+ if ((aFlags & WP_STATE_START_DOC) == WP_STATE_START_DOC
+ && aRequest instanceof Ci.nsIChannel
+ && !(aRequest.loadFlags & aRequest.LOAD_INITIAL_DOCUMENT_URI)
+ && aRequest.URI.spec == "about:blank") {
+ torbutton_log(3, "Passing on about:blank");
+ return 0;
+ }
+
if(aProgress) {
try {
DOMWindow = aProgress.DOMWindow;
@@ -2814,7 +2828,7 @@
DOMWindow = null;
}
}
-
+
if(!DOMWindow) {
try {
if(aRequest.notificationCallbacks) {
@@ -2970,25 +2984,25 @@
onStateChange: function(aProgress, aRequest, aFlag, aStatus)
{
torbutton_eclog(1, 'State change()');
- return torbutton_check_progress(aProgress, aRequest);
+ return torbutton_check_progress(aProgress, aRequest, aFlag);
},
onLocationChange: function(aProgress, aRequest, aURI)
{
torbutton_eclog(1, 'onLocationChange: '+aURI.asciiSpec);
- return torbutton_check_progress(aProgress, aRequest);
+ return torbutton_check_progress(aProgress, aRequest, 0);
},
onProgressChange: function(aProgress, aRequest, curSelfProgress, maxSelfProgress, curTotalProgress, maxTotalProgress)
{
torbutton_eclog(1, 'called progressChange');
- return torbutton_check_progress(aProgress, aRequest);
+ return torbutton_check_progress(aProgress, aRequest, 0);
},
onStatusChange: function(aProgress, aRequest, stat, message)
{
torbutton_eclog(1, 'called progressChange');
- return torbutton_check_progress(aProgress, aRequest);
+ return torbutton_check_progress(aProgress, aRequest, 0);
},
onSecurityChange: function() {return 0;},
More information about the tor-commits
mailing list