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

Side by Side Diff: components/dom_distiller/core/javascript/is_readable.js

Issue 464973002: JavaScript that returns whether or not a page is an article (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 function() {
Yaron 2014/08/12 18:55:05 Rename something like is_distillable_trigger
Yaron 2014/08/12 18:55:05 Add copyright
smaslo 2014/08/12 20:42:23 Done.
smaslo 2014/08/12 20:42:23 I renamed the class. If I give the method a name,
2 var elems = document.querySelectorAll(
3 'meta[property="og:type"],meta[name=\\"og:type\\"]');
4 for (var i in elems) {
5 if (elems[i].content && elems[i].content.toUpperCase() == 'ARTICLE') {
6 return true;
7 }
8 }
9 var elems = document.querySelectorAll(
10 '*[itemtype="http://schema.org/Article"]');
11 for (var i in elems) {
12 if (elems[i].itemscope) {
13 return true;
14 }
15 }
16 return false;
17 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698