OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // TODO(cjhopman): remove dependency on readability. |
| 6 |
| 7 // These includes will be processed at build time by grit. |
| 8 <include src="../../../../third_party/dom_distiller_js/js/domdistiller.js"/> |
| 9 <include src="../../../../third_party/readability/js/readability.js"/> |
| 10 |
| 11 // Extracts long-form content from a page and returns and array where the first |
| 12 // element is the article title, the second element is HTML containing the |
| 13 // long-form content, and remaining elements are URLs for images referenced by |
| 14 // that HTML. Each <img> tag in the HTML has an id field set to k - 2, which |
| 15 // corresponds to a URL listed at index k in the array returned. |
| 16 (function() { |
| 17 readability.init(); |
| 18 var result = new Array(4); |
| 19 result[0] = readability.getArticleTitle(); |
| 20 result[1] = com.dom_distiller.ContentExtractor.extractContent() |
| 21 result[2] = readability.getNextPageLink(); |
| 22 // TODO(shashishekhar): Add actual previous page link here. |
| 23 result[3] = ''; |
| 24 return result.concat(readability.getImages()); |
| 25 })() |
OLD | NEW |