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

Unified Diff: components/dom_distiller/ios/distiller_page_ios.mm

Issue 1004223002: Pass more information by argument to the dom_distiller script. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/ios/distiller_page_ios.mm
diff --git a/components/dom_distiller/ios/distiller_page_ios.mm b/components/dom_distiller/ios/distiller_page_ios.mm
index 4d04aa66a24c55cc5a4a188aa785d7a9edbe5b6e..51ed8fb174b3fd58a0a057c20d7291eb8c67b5f1 100644
--- a/components/dom_distiller/ios/distiller_page_ios.mm
+++ b/components/dom_distiller/ios/distiller_page_ios.mm
@@ -51,6 +51,19 @@ DistillerPageIOS::DistillerPageIOS(web::BrowserState* browser_state)
DistillerPageIOS::~DistillerPageIOS() {
}
+bool DistillerPageIOS::StringifyOutput() {
+ // UIWebView requires javascript to return a single string value.
nyquist 2015/03/16 20:39:03 Nit: JavaScript
noyau (Ping after 24h) 2015/03/17 10:35:39 Done.
+ return true;
+}
+
+bool DistillerPageIOS::CreateNewContext() {
+ // UIWebView's JavaScript engine has a bug that causes crashes when
+ // creating a separate window object, so allow the script to run directly
+ // in the window until a better solution is created.
+ // TODO(kkhorimoto): investigate whether this is necessary for WKWebView.
+ return false;
+}
+
void DistillerPageIOS::DistillPageImpl(const GURL& url,
const std::string& script) {
if (!url.is_valid() || !script.length())

Powered by Google App Engine
This is Rietveld 408576698