From 9846b8bfbef4579497c9c897e5c8a84012b9e879 Mon Sep 17 00:00:00 2001 From: Barbara Bermes Date: Wed, 2 Mar 2016 15:36:05 -0500 Subject: [PATCH] Bug 1252617 - Probe to measure when offline error page is shown. r=mfinkle --- mobile/android/chrome/content/browser.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 47b89b863786..68b299ec19ee 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -4009,12 +4009,21 @@ Tab.prototype = { 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