mascara icon indicating copy to clipboard operation
mascara copied to clipboard

How to open MM/Mascara when the pop-up window has been closed

Open sulliwane opened this issue 8 years ago • 2 comments

Hello,

I'm wondering how to open the MM/Mascara pop up after it has been closed?

I would like a user who don't have MM plugin installed in the browser to still be able to press a button on my website ("open MM") and it would pop up the mascara window, letting the user interact with MM (switch network etc...)

Simply opening a new tab pointing at "wallet.metamask.io" doesn't seem to have the same effect as the magic "pop up" window that shows up I don't know how... :)

Many thanks!

sulliwane avatar Nov 19 '17 21:11 sulliwane

@sulliwane popup's can only be opened due to a user interaction eg.: click

frankiebee avatar Nov 20 '17 17:11 frankiebee

thank you @frankiebee for your reply. That's precisely what I'm trying to do, let the user click on a button (on my frontend) so it opens the Mascara popup...

Right now, only when calling a wallet function will it open mascara:

import tokenJSON from 'token.json'
import metamask from 'metamascara'
import EthJs from 'ethjs'
const ethereumProvider = metamask.createDefaultProvider()
const ethjs = new EthJs(ethereumProvider)
const tokenContract = ethjs.contract(tokenJSON.abi, tokenJSON.unlinked_binary, { from: accounts[0] }).at(tokenJSON.networks[42].address)
tokenContract.transfer(addr, 10)  //  <-- this will open the pop-up, but as soon as the user ACCEPT the transaction, the pop-up is closed, and I have no way to see mascara (if I don't have the plugin installed)

As soon as my user ACCEPT the transaction (a transfer or whatever that requires him to sign something with MM) then the pop-up is closed !!

Is there any way to open mascara, WITHOUT sending a transaction signing request to my user (just plain "open") ?

I'm not sure if I'm clear :)

Thanks

sulliwane avatar Nov 21 '17 15:11 sulliwane