diff --git a/Makefile b/Makefile index d022fbaf27..d35db68589 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/ui/app/AppLayouts/Browser/provider/js/webengine_runtime_guard.js b/ui/app/AppLayouts/Browser/provider/js/webengine_runtime_guard.js new file mode 100644 index 0000000000..841e44cff2 --- /dev/null +++ b/ui/app/AppLayouts/Browser/provider/js/webengine_runtime_guard.js @@ -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; +} diff --git a/ui/app/AppLayouts/Browser/provider/qml/BrowserConfig.qml b/ui/app/AppLayouts/Browser/provider/qml/BrowserConfig.qml index b1306765b7..0fc66df26f 100644 --- a/ui/app/AppLayouts/Browser/provider/qml/BrowserConfig.qml +++ b/ui/app/AppLayouts/Browser/provider/qml/BrowserConfig.qml @@ -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 },