summaryrefslogtreecommitdiffstats
path: root/src/core/web_engine_context.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-11-05 13:39:54 +0100
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-11-06 10:18:17 +0000
commitfebb6cf2d85c680271f5b0cebf8c7e54c805370f (patch)
tree8fb8749a3fbbccce481add21c65b6629b9e8062e /src/core/web_engine_context.cpp
parentad6f5510be6e36bf1e9a9ea6984a9b7cb3955628 (diff)
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 <davidsz@inf.u-szeged.hu> Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'src/core/web_engine_context.cpp')
-rw-r--r--src/core/web_engine_context.cpp4
1 files changed, 4 insertions, 0 deletions
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<const char*> argv(args.size());
for (int i = 0; i < args.size(); ++i)
argv[i] = args[i].constData();