Bug 653307: Adjust reCAPTCHA NoScript hack in Sync. r=philiKON
authorRichard Newman <rnewman@mozilla.com>
Fri, 29 Apr 2011 10:57:59 -0700
changeset 68927 c01dba4456f9903f589df357ecd29ee54d27ee1a
parent 68926 62317ba65526165aaf154208732889624967836a
child 68928 f3eba0269bb2c5f094211d88b0be75255069028f
push id19802
push userpweitershausen@mozilla.com
push dateTue, 03 May 2011 23:30:23 +0000
treeherdermozilla-central@dcdb0421464d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersphiliKON
bugs653307
milestone6.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 653307: Adjust reCAPTCHA NoScript hack in Sync. r=philiKON
browser/base/content/syncSetup.js
--- a/browser/base/content/syncSetup.js
+++ b/browser/base/content/syncSetup.js
@@ -51,37 +51,43 @@ const NEW_ACCOUNT_START_PAGE        = 1;
 const NEW_ACCOUNT_PP_PAGE           = 2;
 const NEW_ACCOUNT_CAPTCHA_PAGE      = 3;
 const EXISTING_ACCOUNT_CONNECT_PAGE = 4;
 const EXISTING_ACCOUNT_LOGIN_PAGE   = 5;
 const OPTIONS_PAGE                  = 6;
 const OPTIONS_CONFIRM_PAGE          = 7;
 const SETUP_SUCCESS_PAGE            = 8;
 
+// Broader than we'd like, but after this changed from api-secure.recaptcha.net
+// we had no choice. At least we only do this for the duration of setup.
+// See discussion in Bugs 508112 and 653307.
+const RECAPTCHA_DOMAIN = "https://www.google.com";
+
 Cu.import("resource://services-sync/main.js");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/PluralForm.jsm");
 
 var gSyncSetup = {
   QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports,
                                          Ci.nsIWebProgressListener,
                                          Ci.nsISupportsWeakReference]),
 
   captchaBrowser: null,
   wizard: null,
   _disabledSites: [],
-  _remoteSites: [Weave.Service.serverURL, "https://api-secure.recaptcha.net"],
 
   status: {
     password: false,
     email: false,
     server: false
   },
 
+  get _remoteSites() [Weave.Service.serverURL, RECAPTCHA_DOMAIN],
+
   get _usingMainServers() {
     if (this._settingUpNew)
       return document.getElementById("server").selectedIndex == 0;
     return document.getElementById("existingServer").selectedIndex == 0;
   },
 
   init: function () {
     let obs = [