Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(346)

Unified Diff: components/dom_distiller/content/resources/dom_distiller_viewer.js

Issue 502653002: Add UMA metric for "View Original" link clicks in distilled page viewer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/dom_distiller/content/resources/dom_distiller_viewer.js
diff --git a/components/dom_distiller/content/resources/dom_distiller_viewer.js b/components/dom_distiller/content/resources/dom_distiller_viewer.js
index 3a7d0a078f2b9101073db6c1140375f9a3f4a222..9894065d4eb227e3b5fd70b170dbb0cb6880cb0e 100644
--- a/components/dom_distiller/content/resources/dom_distiller_viewer.js
+++ b/components/dom_distiller/content/resources/dom_distiller_viewer.js
@@ -65,3 +65,11 @@ var updateLoadingIndicator = function() {
}
};
}();
+
+// Add a listener to the "View Original" link to report opt-outs.
+document.getElementById('showOriginal').addEventListener('click', function(e) {
+ var img = document.createElement('img');
+ img.src = "/vieworiginal";
nyquist 2014/08/25 01:13:03 Would this ever show up as an ugly visual artifact
Yaron 2014/08/25 19:41:23 Hmm. I suppose it's possible. Added display:none.
+ document.body.appendChild(img);
nyquist 2014/08/25 01:13:03 Since the click will navigate away, could there be
Yaron 2014/08/25 19:41:23 I don't think so. Remember that the backend is alw
nyquist 2014/08/25 20:09:19 Right, I think I was just concerned that the netwo
+}, true);
+

Powered by Google App Engine
This is Rietveld 408576698