[Pkg-mozext-commits] [gcontactsync] 01/09: Issue #75: Expired token dialog doesn't automatically close.

David Prévot taffit at moszumanska.debian.org
Sun Apr 12 03:15:02 UTC 2015


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

taffit pushed a commit to branch master
in repository gcontactsync.

commit c6c9af7c59a7e46c3e54e8f0c205c5830b1f5972
Author: Josh Geenen <joshgeenen at gmail.com>
Date:   Sat Apr 4 13:55:06 2015 -0500

    Issue #75: Expired token dialog doesn't automatically close.
---
 src/content/OAuth2.js |  6 ++----
 src/content/gdata.js  | 12 ++++++++----
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/content/OAuth2.js b/src/content/OAuth2.js
index dd1bd90..fe6a1a1 100644
--- a/src/content/OAuth2.js
+++ b/src/content/OAuth2.js
@@ -88,10 +88,8 @@ com.gContactSync.OAuth2 = {
    * Checks the title of the browser for the requested title indicating a code.
    */
   checkTitle: function OAuth2_checkTitle() {
-
-    var title = com.gContactSync.OAuth2.mBrowserElem.contentDocument.title;
-
-    if (title.indexOf(com.gContactSync.OAuth2.mBrowserTitle) === 0) {
+    var title = com.gContactSync.OAuth2.mBrowserElem.contentTitle;
+    if (title && title.indexOf(com.gContactSync.OAuth2.mBrowserTitle) === 0) {
       com.gContactSync.OAuth2.onCodeReceived(title.substring(com.gContactSync.OAuth2.mBrowserTitle.length));
     } else {
       setTimeout(com.gContactSync.OAuth2.checkTitle, 500);
diff --git a/src/content/gdata.js b/src/content/gdata.js
index 783e6a6..a63ca6e 100644
--- a/src/content/gdata.js
+++ b/src/content/gdata.js
@@ -473,10 +473,14 @@ com.gContactSync.gdata = {
       var url = com.gContactSync.gdata.getOAuthURL(aEmail);
       com.gContactSync.LOGGER.VERBOSE_LOG("Opening browser with URL: " + url);
       browser.loadURI(url);
-      com.gContactSync.OAuth2.init(browser, com.gContactSync.gdata.REDIRECT_URI, function callback(aResponse) {
-        wizard.close();
-        aCallback(aResponse);
-      });
+      com.gContactSync.OAuth2.init(browser,
+                                   com.gContactSync.gdata.REDIRECT_URI,
+                                   function callback(aResponse) {
+                                      wizard.close();
+                                      aCallback(aResponse);
+                                    },
+                                   com.gContactSync.gdata.REDIRECT_TITLE
+      );
     });
   },
 };

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



More information about the Pkg-mozext-commits mailing list