Commit 7e05570f authored by Andreas Traczyk's avatar Andreas Traczyk

message view: fix image loading by disabling web security

Change-Id: Ic385202733a310e4b8d85bca0fe9d53d107b71c1
parent 3199a1f0
......@@ -106,7 +106,16 @@ main(int argc, char *argv[])
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
QApplication a(argc, argv);
char ARG_DISABLE_WEB_SECURITY[] = "--disable-web-security";
int newArgc = argc + 1 + 1;
char** newArgv = new char*[newArgc];
for (int i = 0; i < argc; i++) {
newArgv[i] = argv[i];
}
newArgv[argc] = ARG_DISABLE_WEB_SECURITY;
newArgv[argc + 1] = nullptr;
QApplication a(newArgc, newArgv);
QCoreApplication::setOrganizationDomain("jami.net");
QCoreApplication::setApplicationName("Ring");
......
......@@ -56,6 +56,12 @@ MessageWebView::MessageWebView(QWidget *parent)
settings()->setAttribute(QWebEngineSettings::ScreenCaptureEnabled, false);
settings()->setAttribute(QWebEngineSettings::LinksIncludedInFocusChain, false);
settings()->setAttribute(QWebEngineSettings::LocalStorageEnabled, false);
settings()->setAttribute(QWebEngineSettings::AllowRunningInsecureContent, true);
settings()->setAttribute(QWebEngineSettings::LocalContentCanAccessRemoteUrls, true);
settings()->setAttribute(QWebEngineSettings::XSSAuditingEnabled, false);
settings()->setAttribute(QWebEngineSettings::LocalContentCanAccessFileUrls, true);
settings()->setFontSize(QWebEngineSettings::MinimumFontSize, 2);
setContextMenuPolicy(Qt::ContextMenuPolicy::NoContextMenu);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment