Bug 1252617 - Probe to measure when offline error page is shown. r=mfinkle
authorBarbara Bermes <bbermes@mozilla.com>
Wed, 02 Mar 2016 15:36:05 -0500
changeset 287338 893ca601352abf582cb64e1cfbcec68dcc06871a
parent 287337 3071a0f6359d689fa1b17ba657b4f6afbde9399c
child 287339 865dec79d8c1579af2999424822ed1c53d8e9082
push id30067
push usercbook@mozilla.com
push dateWed, 09 Mar 2016 10:45:35 +0000
treeherdermozilla-central@ebcf7897ef0e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs1252617
milestone48.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 1252617 - Probe to measure when offline error page is shown. r=mfinkle
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -4004,22 +4004,31 @@ Tab.prototype = {
           let computedStyle = contentWindow.getComputedStyle(contentDocument.body);
           backgroundColor = computedStyle.backgroundColor;
         } catch (e) {
           // Ignore. Catching and ignoring exceptions here ensures that Talos succeeds.
         }
 
         let docURI = target.documentURI;
         let errorType = "";
-        if (docURI.startsWith("about:certerror"))
+        if (docURI.startsWith("about:certerror")) {
           errorType = "certerror";
-        else if (docURI.startsWith("about:blocked"))
-          errorType = "blocked"
-        else if (docURI.startsWith("about:neterror"))
+        }
+        else if (docURI.startsWith("about:blocked")) {
+          errorType = "blocked";
+        }
+        else if (docURI.startsWith("about:neterror")) {
+          let error = docURI.search(/e\=/);
+          let duffUrl = docURI.search(/\&u\=/);
+          let errorExtra = decodeURIComponent(docURI.slice(error + 2, duffUrl));
+          // Here is a list of errorExtra types (et_*)
+          // http://mxr.mozilla.org/mozilla-central/source/mobile/android/chrome/content/netError.xhtml#287
+          UITelemetry.addEvent("neterror.1", "content", null, errorExtra);
           errorType = "neterror";
+        }
 
         // Attach a listener to watch for "click" events bubbling up from error
         // pages and other similar page. This lets us fix bugs like 401575 which
         // require error page UI to do privileged things, without letting error
         // pages have any privilege themselves.
         if (docURI.startsWith("about:neterror")) {
           NetErrorHelper.attachToBrowser(this.browser);
         }