Commit eb7350d0 authored by kuan@chromium.org's avatar kuan@chromium.org

pull in dom distiller changes from gwt codebase

5f27b684f7: debugging mechanism for processing of next/prev page links
            - for easier debugging, disable next-page links in chrome viewer
7a12a9972b: recognize and parse OpenGraph Protocol Markup
0dcb6d78f6: recognize and parse IE Reading View Markup
8fe69642d3: recognize and parse Schema.org Markup
feccd237e1: composite MarkupParser that requests properties from the above 3
            parsers and expose them to chrome viewer

BUG=356336, 362085, 364356

NOTRY=true

Review URL: https://codereview.chromium.org/266823005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268317 0039d316-1c4b-4281-b951-d872f2087c98
parent 55609a81
......@@ -19,6 +19,48 @@
document.documentElement);
// TODO(shashishekhar): Add actual previous page link here.
result[3] = '';
/**
* // Properties from markup tags.
*
* var parser = new com.dom_distiller.MarkupParser(document.documentElement);
* if (!parser.optOut()) {
* // Basic properties.
* var title = parser.getTitle(); // String type.
* var pageType = parser.getType(); // String type.
* var pageUrl = parser.getUrl(); // String type.
* var author = parser.getAuthor(); // String type.
* var description = parser.getDescription(); // String type.
* var publisher = parser.getPublisher(); // String type.
* var copyright = parser.getCopyright(); // String type.
*
* // Structured Image's.
* var images = parser.getImages();
* for (var i = 0; i < images.length; i++) {
* var image = images[i];
* var url = image.getUrl(); // String type.
* var secureUrl = image.getSecureUrl(); // String type.
* var type = image.getType(); // String type.
* var caption = image.getCaption(); // String type.
* var width = image.getWidth(); // int type.
* var height = image.getHeight(); // int type.
* }
*
* // Structured Article.
* var article = parser.getArticle();
* if (article != null) {
* var publishedTime = article.getPublishedTime(); // String type.
* var modifiedTime = article.getModifiedTime(); // String type.
* var expirationTime = article.getExpirationTime(); // String type.
* var sectionName = article.getSection(); // String type.
* var authors = article.getAuthors();
* for (var i = 0; i < authors.length; i++) {
* var author = authors[i]; // String type.
* }
* }
* }
*/
} catch (e) {
window.console.log("Error during distillation: " + e);
}
......
Name: dom-distiller-js
URL: https://code.google.com/p/dom-distiller
Version: d690d4a859
Version: feccd237e1
License: BSD
Security Critical: yes
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment