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

Unified Diff: chrome/android/java/res/raw/parse.js

Issue 2622313002: Add app indexing reporter public class. (Closed)
Patch Set: Add app indexing reporter public class. Created 3 years, 11 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 | chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/res/raw/parse.js
diff --git a/chrome/android/java/res/raw/parse.js b/chrome/android/java/res/raw/parse.js
new file mode 100644
index 0000000000000000000000000000000000000000..91a15b2aeb7240b0efac379aa00568e51f9ba300
--- /dev/null
+++ b/chrome/android/java/res/raw/parse.js
@@ -0,0 +1,9 @@
+/* Copyright 2017 The Chromium Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ *
+ * TODO(dproctor): This works only for JSON-LD data. If we want to support other
+ * data formats, such as Microdata, RDF, etc. we'll need to include a parsing
+ * library.
+ */
+var a=document.querySelectorAll("script[type=\"application/ld+json\"]");if(a){ var b=[];a.forEach(function(s) {b.push(JSON.parse(s.innerHTML)) });b; }
wychen 2017/02/13 22:08:06 A few corner cases we might want to handle: { "
dproctor 2017/02/13 23:11:57 Hey, thanks for raising the issue. I didn't see an
wychen 2017/02/13 23:44:31 I think flattening sounds nice, but then it would
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698