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

Side by Side Diff: extract_features.js

Issue 1620043002: Add scripts for distillability modelling (Closed) Base URL: git@github.com:chromium/dom-distiller.git@master
Patch Set: set upstream patchset, identical to patch set 2 Created 4 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 unified diff | Download patch
« no previous file with comments | « calculate_derived_features.py ('k') | foo/index » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 return (function() {
2 function hasOGArticle() {
3 var elems = document.head.querySelectorAll(
4 'meta[property="og:type"],meta[name="og:type"]');
5 for (var i in elems) {
6 if (elems[i].content && elems[i].content.toUpperCase() == 'ARTICLE') {
7 return true;
8 }
9 }
10 return false;
11 }
12
13 var body = document.body;
14 return {
15 'opengraph': hasOGArticle(),
16 'url': document.location.href,
17 'numElements': body.querySelectorAll('*').length,
18 'numAnchors': body.querySelectorAll('a').length,
19 'numForms': body.querySelectorAll('form').length,
20 'innerText': body.innerText,
21 'textContent': body.textContent,
22 'innerHTML': body.innerHTML,
23 }
24 })()
OLDNEW
« no previous file with comments | « calculate_derived_features.py ('k') | foo/index » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698