Bug 1252239: Trap errors thrown by speculativeConnect. r=ttaubert
authorKris Maglione <maglione.k@gmail.com>
Mon, 29 Feb 2016 13:06:26 -0800
changeset 322363 e3f38a0b663f2c0aeb5bef33cf7e79868d7d4853
parent 322362 317bf83620561efe9ef92b321ac3fc2498321f3b
child 322364 57774ff596857a1567ff5e40ce44cbbe2ec8308a
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersttaubert
bugs1252239
milestone47.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 1252239: Trap errors thrown by speculativeConnect. r=ttaubert MozReview-Commit-ID: Bbik1htw3qk
browser/base/content/newtab/sites.js
--- a/browser/base/content/newtab/sites.js
+++ b/browser/base/content/newtab/sites.js
@@ -290,17 +290,21 @@ Site.prototype = {
   },
 
   /**
    * Speculatively opens a connection to the current site.
    */
   _speculativeConnect: function Site_speculativeConnect() {
     let sc = Services.io.QueryInterface(Ci.nsISpeculativeConnect);
     let uri = Services.io.newURI(this.url, null, null);
-    sc.speculativeConnect(uri, null);
+    try {
+      // This can throw for certain internal URLs, when they wind up in
+      // about:newtab. Be sure not to propagate the error.
+      sc.speculativeConnect(uri, null);
+    } catch (e) {}
   },
 
   /**
    * Record interaction with site using telemetry.
    */
   _recordSiteClicked: function Site_recordSiteClicked(aIndex) {
     if (Services.prefs.prefHasUserValue("browser.newtabpage.rows") ||
         Services.prefs.prefHasUserValue("browser.newtabpage.columns") ||