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

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: s/javascript/JavaScript 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
« no previous file with comments | « components/dom_distiller/ios/distiller_page_ios.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..bdf41087079c5c68539af796214980b3beee25da 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.
+ 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())
« no previous file with comments | « components/dom_distiller/ios/distiller_page_ios.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698