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

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

Issue 266823005: pull in dom distiller changes from gwt codebase (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
« no previous file with comments | « no previous file | third_party/dom_distiller_js/README.chromium » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
index ce0ebd821f5abee76ae77855f1684484e4d29b7e..62f860b5003aae5d4d549c261fcb70bd5cb0780d 100644
--- a/components/dom_distiller/core/javascript/domdistiller.js
+++ b/components/dom_distiller/core/javascript/domdistiller.js
@@ -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);
}
« no previous file with comments | « no previous file | third_party/dom_distiller_js/README.chromium » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698