diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/api/qtwebenginecoreglobal.cpp | 2 | ||||
-rw-r--r-- | src/core/core_module.pro | 14 | ||||
-rw-r--r-- | src/core/web_contents_delegate_qt.cpp | 5 |
3 files changed, 16 insertions, 5 deletions
diff --git a/src/core/api/qtwebenginecoreglobal.cpp b/src/core/api/qtwebenginecoreglobal.cpp index ad52d09ad..25d0bd3be 100644 --- a/src/core/api/qtwebenginecoreglobal.cpp +++ b/src/core/api/qtwebenginecoreglobal.cpp @@ -80,6 +80,8 @@ static QOpenGLContext *shareContext; static void deleteShareContext() { + if (qt_gl_global_share_context() == shareContext) + qt_gl_set_global_share_context(nullptr); delete shareContext; shareContext = 0; } diff --git a/src/core/core_module.pro b/src/core/core_module.pro index 02aa6ac38..b220af4a5 100644 --- a/src/core/core_module.pro +++ b/src/core/core_module.pro @@ -42,11 +42,15 @@ LIBS_PRIVATE += $$NINJA_LIB_DIRS $$NINJA_LIBS unix:qtConfig(webengine-noexecstack): \ QMAKE_LFLAGS += -Wl,-z,noexecstack linux { - QMAKE_LFLAGS += -Wl,--gc-sections -Wl,-O1 -Wl,-z,now - # Embedded address sanitizer symbols are undefined and are picked up by the dynamic link loader - # at runtime. Thus we do not to pass the linker flag below, because the linker would complain - # about the undefined sanitizer symbols. - !sanitizer: QMAKE_LFLAGS += -Wl,-z,defs + # add chromium flags + for(flag, NINJA_LFLAGS) { + # filter out some flags + !contains(flag, .*noexecstack$): \ + !contains(flag, .*as-needed$): \ + !contains(flag, ^-B.*): \ + !contains(flag, ^-fuse-ld.*): \ + QMAKE_LFLAGS += $$flag + } } else { QMAKE_LFLAGS += $$NINJA_LFLAGS } diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp index c8fac0d54..f260a17b9 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -232,6 +232,11 @@ void WebContentsDelegateQt::AddNewContents(content::WebContents* source, std::un { Q_UNUSED(source) QSharedPointer<WebContentsAdapter> newAdapter = createWindow(std::move(new_contents), disposition, initial_pos, user_gesture); + // Chromium can forget to pass user-agent override settings to new windows (see QTBUG-61774 and QTBUG-76249), + // so set it here. Note the actual value doesn't really matter here. Only the second value does, but we try + // to give the correct user-agent anyway. + if (newAdapter) + newAdapter->webContents()->SetUserAgentOverride(newAdapter->profileAdapter()->httpUserAgent().toStdString(), true); if (newAdapter && !newAdapter->isInitialized()) newAdapter->loadDefault(); if (was_blocked) |