mirror of
https://github.com/status-im/status-app.git
synced 2026-08-27 07:01:14 +00:00
fix(Browser): Prevent access to Chrome extension messaging API
Meanwhile we don't support Chrome extensions in the embedded browser, prevent access to specific extension messaging APIs that can cause QtWebEngine crashes. Fix #21122
This commit is contained in:
@@ -597,9 +597,9 @@ ifeq ($(REBUILD_UI),true)
|
||||
endif
|
||||
|
||||
ifeq ($(host_os),darwin)
|
||||
UI_SOURCES := $(shell find -E ui -type f -iregex '.*(qmldir|qml|qrc)$$' -not -iname 'resources.qrc')
|
||||
UI_SOURCES := $(shell find -E ui -type f -iregex '.*(qmldir|qml|qrc|js)$$' -not -iname 'resources.qrc')
|
||||
else
|
||||
UI_SOURCES := $(shell find ui -type f -regextype egrep -iregex '.*(qmldir|qml|qrc)$$' -not -iname 'resources.qrc')
|
||||
UI_SOURCES := $(shell find ui -type f -regextype egrep -iregex '.*(qmldir|qml|qrc|js)$$' -not -iname 'resources.qrc')
|
||||
endif
|
||||
|
||||
UI_RESOURCES := resources.rcc
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// Status does not implement Chrome extensions. Prevent page access to the
|
||||
// Chrome extension messaging API from causing crashes in QtWebEngine.
|
||||
if (window.chrome && window.chrome.runtime) {
|
||||
window.chrome.runtime.sendMessage = undefined;
|
||||
window.chrome.runtime.connect = undefined;
|
||||
}
|
||||
@@ -16,6 +16,7 @@ QtObject {
|
||||
property string httpUserAgent: ""
|
||||
|
||||
readonly property var scriptPaths: root.featureEnabled ? [
|
||||
{ path: Qt.resolvedUrl("../js/webengine_runtime_guard.js"), runOnSubFrames: true },
|
||||
{ path: Qt.resolvedUrl("../js/qwebchannel.js"), runOnSubFrames: true },
|
||||
{ path: Qt.resolvedUrl("../js/ethereum_wrapper.js"), runOnSubFrames: true },
|
||||
{ path: Qt.resolvedUrl("../js/eip6963_announcer.js"), runOnSubFrames: false },
|
||||
|
||||
Reference in New Issue
Block a user