From febb6cf2d85c680271f5b0cebf8c7e54c805370f Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 5 Nov 2015 13:39:54 +0100 Subject: Fix JavaScript injection for Chromium 47 By default Chromium does not allow injecting javascript, however since this is a standard webview feature they have a function the Android WebView calls to allow it anyway, which we can also use. Change-Id: I692864bb78e177c2da07a9a80e756e4f10ec1a32 Task-number: QTBUG-49235 Reviewed-by: Szabolcs David Reviewed-by: Joerg Bornemann --- src/core/web_engine_context.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/core/web_engine_context.cpp') diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index 7c7b53e7c..5be35b348 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -52,6 +52,7 @@ #include "content/public/app/content_main.h" #include "content/public/app/content_main_runner.h" #include "content/public/browser/browser_main_runner.h" +#include "content/public/browser/render_frame_host.h" #include "content/public/common/content_paths.h" #include "content/public/common/content_switches.h" #include "content/public/common/main_function_params.h" @@ -208,6 +209,9 @@ WebEngineContext::WebEngineContext() useEmbeddedSwitches = !args.removeAll("--disable-embedded-switches"); #endif + // Allow us to inject javascript like any webview toolkit. + content::RenderFrameHost::AllowInjectingJavaScriptForAndroidWebView(); + QVector argv(args.size()); for (int i = 0; i < args.size(); ++i) argv[i] = args[i].constData(); -- cgit v1.2.3