Access browser window object

Hello, is there any way to access the browser windows object from Backendless frontend? I’m trying to work with Metamask and Ethereum network. Thank you very much.

Hi @Harlock !

You can get access to the browser window object using a small “trick” via JS object properties.
For example, if you have component someComponent then browser window object will be available by next path someComponent.el.ownerDocument.defaultView.

In Codeless Logic it will look in next way:
image (2)

Regards, Andriy

Thank you @Andriy, that’s work fine, now I got the window object!
Just another related question, what’s the better way to execute a client site script in Backendless…something like:
await window.ethereum.send(‘eth_requestAccounts’);
Is this possible too?

Unfortunatelly it is not possible right now, but we going to add this possibility to one of our future releases.
Sorry for inconvenience.

Regards, Andriy

That would be great. Many thanks