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

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: add display:none 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..55f53bbf3854feaebdf305bed92df2acce7a9ef2 100644
--- a/components/dom_distiller/content/resources/dom_distiller_viewer.js
+++ b/components/dom_distiller/content/resources/dom_distiller_viewer.js
@@ -65,3 +65,12 @@ 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";
+ img.style.display = "none";
+ document.body.appendChild(img);
+}, true);
+
« no previous file with comments | « components/dom_distiller/content/resources/dom_distiller_viewer.html ('k') | components/dom_distiller/core/url_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698