@@ -17,6 +17,7 @@ import shared.popups.send
1717import shared.stores.send
1818
1919import AppLayouts.Browser.stores as BrowserStores
20+ import "provider"
2021
2122import "popups"
2223import "controls"
@@ -41,6 +42,7 @@ StatusSectionLayout {
4142 required property BrowserStores .DownloadsStore downloadsStore
4243 required property BrowserStores .BrowserRootStore browserRootStore
4344 required property BrowserStores .BrowserWalletStore browserWalletStore
45+ required property var connectorController
4446
4547 signal sendToRecipientRequested (string address)
4648
@@ -49,6 +51,22 @@ StatusSectionLayout {
4951 tab .url = _internal .determineRealURL (url)
5052 }
5153
54+ ConnectorBridge {
55+ id: connectorBridge
56+
57+ userUID: root .userUID
58+ connectorController: root .connectorController
59+ defaultAccountAddress: root .browserWalletStore .dappBrowserAccount .address
60+ accountsModel: root .browserWalletStore .accounts
61+ httpUserAgent: {
62+ if (localAccountSensitiveSettings .compatibilityMode ) {
63+ // Google doesn't let you connect if the user agent is Chrome-ish and doesn't satisfy some sort of hidden requirement
64+ return " Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36"
65+ }
66+ return " "
67+ }
68+ }
69+
5270 QtObject {
5371 id: _internal
5472
@@ -91,32 +109,13 @@ StatusSectionLayout {
91109 standardButtons: Dialog .Ok
92110 }
93111
94- property QtObject defaultProfile: WebEngineProfile {
95- storageName: " Profile_%1" .arg (root .userUID )
96- offTheRecord: false
97- httpUserAgent: {
98- if (localAccountSensitiveSettings .compatibilityMode ) {
99- // Google doesn't let you connect if the user agent is Chrome-ish and doesn't satisfy some sort of hidden requirement
100- return " Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36"
101- }
102- return " "
103- }
104- }
105-
106- property QtObject otrProfile: WebEngineProfile {
107- storageName: " IncognitoProfile_%1" .arg (root .userUID )
108- offTheRecord: true
109- persistentCookiesPolicy: WebEngineProfile .NoPersistentCookies
110- httpUserAgent: _internal .defaultProfile .httpUserAgent
111- }
112-
113112 function addNewDownloadTab () {
114- tabs .createDownloadTab (tabs .count !== 0 ? currentWebView .profile : defaultProfile);
113+ tabs .createDownloadTab (tabs .count !== 0 ? currentWebView .profile : connectorBridge . defaultProfile );
115114 tabs .currentIndex = tabs .count - 1 ;
116115 }
117116
118117 function addNewTab () {
119- var tab = tabs .createEmptyTab (tabs .count !== 0 ? currentWebView .profile : defaultProfile);
118+ var tab = tabs .createEmptyTab (tabs .count !== 0 ? currentWebView .profile : connectorBridge . defaultProfile );
120119 browserHeader .addressBar .forceActiveFocus ();
121120 browserHeader .addressBar .selectAll ();
122121
@@ -218,9 +217,9 @@ StatusSectionLayout {
218217 }
219218 onOpenNewTabTriggered: _internal .addNewTab ()
220219 Component .onCompleted : {
221- _internal .defaultProfile .downloadRequested .connect (_internal .onDownloadRequested );
222- _internal .otrProfile .downloadRequested .connect (_internal .onDownloadRequested );
223- var tab = createEmptyTab (_internal .defaultProfile , true );
220+ connectorBridge .defaultProfile .downloadRequested .connect (_internal .onDownloadRequested );
221+ connectorBridge .otrProfile .downloadRequested .connect (_internal .onDownloadRequested );
222+ var tab = createEmptyTab (connectorBridge .defaultProfile , true );
224223 // For Devs: Uncomment the next line if you want to use the simpledapp on first load
225224 // tab.url = root.browserRootStore.determineRealURL("https://simpledapp.eth");
226225 }
@@ -312,11 +311,11 @@ StatusSectionLayout {
312311 id: settingsMenu
313312 x: parent .width - width
314313 y: browserHeader .y + browserHeader .height
315- isIncognito: _internal .currentWebView && _internal .currentWebView .profile === _internal .otrProfile
314+ isIncognito: _internal .currentWebView && _internal .currentWebView .profile === connectorBridge .otrProfile
316315 onAddNewTab: _internal .addNewTab ()
317316 onGoIncognito : function (checked ) {
318317 if (_internal .currentWebView ) {
319- _internal .currentWebView .profile = checked ? _internal .otrProfile : _internal .defaultProfile ;
318+ _internal .currentWebView .profile = checked ? connectorBridge .otrProfile : connectorBridge .defaultProfile ;
320319 }
321320 }
322321 onZoomIn: {
@@ -454,7 +453,7 @@ StatusSectionLayout {
454453 bookmarksStore: root .bookmarksStore
455454 downloadsStore: root .downloadsStore
456455 currentWebView: _internal .currentWebView
457- webChannel: channel
456+ webChannel: connectorBridge . webChannel
458457 findBarComp: findBar
459458 favMenu: favoriteMenu
460459 addFavModal: addFavoriteModal
@@ -541,6 +540,11 @@ StatusSectionLayout {
541540 function onUrlChanged () {
542541 browserHeader .addressBar .text = root .browserRootStore .obtainAddress (_internal .currentWebView .url )
543542 root .browserRootStore .currentTabConnected = false // TODO: Will be handled by connector
543+
544+ // Update ConnectorBridge with current dApp metadata
545+ if (_internal .currentWebView && _internal .currentWebView .url ) {
546+ connectorBridge .updateDAppUrl (_internal .currentWebView .url , _internal .currentWebView .title )
547+ }
544548 }
545549 }
546550
0 commit comments