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

Unified Diff: components/dom_distiller/core/javascript/domdistiller.js

Issue 176083002: Use boilerpipe-based dom-distiller-js (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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/core/javascript/domdistiller.js
diff --git a/components/dom_distiller/core/javascript/domdistiller.js b/components/dom_distiller/core/javascript/domdistiller.js
new file mode 100644
index 0000000000000000000000000000000000000000..762e6ef6cc450c8474187b89b15dc84978075c32
--- /dev/null
+++ b/components/dom_distiller/core/javascript/domdistiller.js
@@ -0,0 +1,22 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+<include src="../../../../third_party/dom_distiller_js/js/domdistiller.js"/>
nyquist 2014/02/26 00:30:15 To be honest, I didn't know RenderViewHost::Execut
nyquist 2014/02/26 00:53:16 In fact, since this is GRIT, could we maybe add a
cjhopman 2014/02/27 02:43:09 Done.
+<include src="../../../../third_party/readability/js/readability.js"/>
+
+// Extracts long-form content from a page and returns and array where the first
+// element is the article title, the second element is HTML containing the
+// long-form content, and remaining elements are URLs for images referenced by
+// that HTML. Each <img> tag in the HTML has an id field set to k - 2, which
+// corresponds to a URL listed at index k in the array returned.
+(function() {
+ readability.init();
Yaron 2014/02/26 02:50:50 Add TODO: remove dependency on readability.
cjhopman 2014/02/27 02:43:09 Done.
+ var result = new Array(4);
+ result[0] = readability.getArticleTitle();
+ result[1] = com.dom_distiller.ContentExtractor.extractContent()
+ result[2] = readability.getNextPageLink();
+ // TODO(shashishekhar): Add actual previous page link here.
+ result[3] = '';
+ return result.concat(readability.getImages());
+})()
« no previous file with comments | « no previous file | components/dom_distiller/core/javascript/readability.js » ('j') | components/dom_distiller_resources.grdp » ('J')

Powered by Google App Engine
This is Rietveld 408576698