Open dariotarantini opened 2 years ago
Here is an example which fail https://gist.github.com/dariotarantini/927ba5ea9556271928fda6274e9fea20 (tonwebjs taken from here https://raw.githubusercontent.com/toncenter/tonweb/master/dist/tonweb.js)
Looks like there was some conficts with another wallet i had, so after removing it everything seems to work.
Looks like there was some conficts with another wallet i had, so after removing it everything seems to work.
Could you please give a link to the conflicting extension and state it's version? Also, please update the issue's title to better reflect the problem.
I think the problem was this extension: https://chrome.google.com/webstore/detail/ever-wallet/cgeeodpfagjceefieflmdfphplkenlfk
This should fix it:
const tonNamespaceObject = { /** define ton object here */ };
const reportConflict = () => console.warn(
`TON extension conflict detected. ` +
`Make sure that you are running only one TON extension.`
);
if ('ton' in window) {
reportConflict();
delete window.ton;
}
Object.defineProperty(window, 'ton', {
get: () => tonNamespaceObject,
set: reportConflict,
});
The browser support is quite good: 94.42%
.
The issue is quite easy to reproduce if you install Chrome extension of MyTonWallet, using Ton Wallet along with MyTonWallet chrome extension is not possible.
I'm prototyping a simple dapp but i can't get it to work well. I don't understand why, but sometimes the extension returns errors when I try to request accounts. When the page loads, it returns this to me:
also, when i call
provider.send('ton_requestAccounts')
it returns