From c115b290f5c27aea7ab41d6a864fa4cfe4d04643 Mon Sep 17 00:00:00 2001 From: bridiver Date: Wed, 16 Jan 2019 14:37:16 -0700 Subject: [PATCH] only call Stop when DistillerPageWebContents::CreateNewWebContents is called. This maintains the original behavior from https://chromium.googlesource.com/chromium/src/+/fb688daf52cef3bb041634888583ee2c28c8af66%5E%21/components/dom_distiller/content/distiller_page_web_contents.cc without breaking sites that use the original webcontents Fix https://github.com/brave/brave-browser/issues/2991 Fix https://github.com/brave/brave-browser/issues/2901 --- ...nt-browser-distiller_page_web_contents.cc.patch | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 patches/components-dom_distiller-content-browser-distiller_page_web_contents.cc.patch diff --git a/patches/components-dom_distiller-content-browser-distiller_page_web_contents.cc.patch b/patches/components-dom_distiller-content-browser-distiller_page_web_contents.cc.patch new file mode 100644 index 000000000000..838007762097 --- /dev/null +++ b/patches/components-dom_distiller-content-browser-distiller_page_web_contents.cc.patch @@ -0,0 +1,14 @@ +diff --git a/components/dom_distiller/content/browser/distiller_page_web_contents.cc b/components/dom_distiller/content/browser/distiller_page_web_contents.cc +index 9dd3a81fea2797c06db85868f0da94612b2a362d..9de2e23743c44deffafa96c7a2bdaabda046de87 100644 +--- a/components/dom_distiller/content/browser/distiller_page_web_contents.cc ++++ b/components/dom_distiller/content/browser/distiller_page_web_contents.cc +@@ -182,7 +182,9 @@ void DistillerPageWebContents::ExecuteJavaScript() { + content::WebContentsObserver::Observe(nullptr); + // Stop any pending navigation since the intent is to distill the current + // page. ++ if (source_page_handle_->web_contents()->GetDelegate() == this) + source_page_handle_->web_contents()->Stop(); ++ + DVLOG(1) << "Beginning distillation"; + RunIsolatedJavaScript( + frame, script_,