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

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

Issue 901793002: Add support for providing an external file for extracting content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved injection to constructor Created 5 years, 9 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
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
deleted file mode 100644
index 8bf3d8c945254caf12fe14378e3e08ea88ab5c8a..0000000000000000000000000000000000000000
--- a/components/dom_distiller/core/javascript/domdistiller.js
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2014 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.
-
-// Applies DomDistillerJs to the content of the page and returns a
-// DomDistillerResults (as a javascript object/dict).
-(function() {
- try {
- // The generated domdistiller.js accesses the window object only explicitly
- // via the window name. So, we create a new object with the normal window
- // object as its prototype and initialize the domdistiller.js with that new
- // context so that it doesn't change the real window object.
- function initialize(window) {
- // This include will be processed at build time by grit.
- <include src="../../../../third_party/dom_distiller_js/package/js/domdistiller.js"/>
- }
- var context = Object.create(window);
- context.setTimeout = function() {};
- context.clearTimeout = function() {};
- initialize(context);
-
- // The OPTIONS placeholder will be replaced with the DomDistillerOptions at
- // runtime.
- var distiller = context.org.chromium.distiller.DomDistiller;
- var res = distiller.applyWithOptions($$OPTIONS);
- return res;
- } catch (e) {
- window.console.error("Error during distillation: " + e);
- if (e.stack != undefined) window.console.error(e.stack);
- }
- return undefined;
-})()

Powered by Google App Engine
This is Rietveld 408576698