Giter Site home page Giter Site logo

mascara's Introduction

MetaMascara

MetaMascara(mascara) brings metamask when metamask is not installed.

Disclaimer:

MetaMascar is in alpha expect breaking changes

to use as a CDN put this script tag in the <head> of your html file:

<script src="https://wallet.metamask.io/metamascara.js"></script>

or bring your own:

npm i --save metamascara

const metamask = require('metamascara')
const EthJs = require('ethjs')

// mascara will use the environmental provider if the user brings one
// in the form of metamask extension, mist or parity
// other wise it will make one for you :}

const ethereumProvider = metamask.createDefaultProvider()

const eth = new EthJs(ethereumProvider)

// do stuff...

Developing:

For development with metamask-extension/mascara to point the iframe at localhost just do:

const metamask = require('metamascara')
const ethereumProvider = metamask.createDefaultProvider({
    host: 'http://localhost:9001'
  }) // or what ever port you use

How does it work and how to use it:

Mascara is an iframe that acts as a proxy between your dapp and metamask core. The metamask core is the global context housed in a service worker, it does the key management for every dapp the user visits.

nomnom

todo's:

mascara's People

Contributors

alextsg avatar danfinlay avatar digitaldonkey avatar frankiebee avatar monokh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mascara's Issues

Is this project still in roadmap?

Hi,
Wanted to know if this project is still in roadmap? I don't see any new development since Dec 2017. Wanted to use this for one of my project

some Errors and no response back

I get these following errors :

13:09:37.369 api.cryptonator.com/api/ticker/eth-USD Failed to load resource: net::ERR_NAME_NOT_RESOLVED
13:09:37.369 background.js:480 MetaMask - Failed to query currency conversion.
(anonymous) @ background.js:480
13:09:37.370 api.infura.io/v2/blacklist Failed to load resource: net::ERR_NAME_NOT_RESOLVED
13:09:37.370 ropsten.infura.io/metamask Failed to load resource: net::ERR_NAME_NOT_RESOLVED
13:09:37.370 background.js:16855 Uncaught (in promise) TypeError: Failed to fetch
13:09:37.374 background.js:16855 Uncaught (in promise) TypeError: Failed to fetch

And then I do not get any response back from my first call : getNetwork not even an error.

This did not happen when I first try. But this time I am in a restricted network (in a public library) if that matters
I ll try again in a different place

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because we are using your CI build statuses to figure out when to notify you about breaking changes.

Since we did not receive a CI status on the greenkeeper/initial branch, we assume that you still need to configure it.

If you have already set up a CI for this repository, you might need to check your configuration. Make sure it will run on all new branches. If you don’t want it to run on every branch, you can whitelist branches starting with greenkeeper/.

We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

Once you have installed CI on this repository, you’ll need to re-trigger Greenkeeper’s initial Pull Request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper integration’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

Metamascara does not default to mainnet

I was hoping to use MetaMascara to allow new users to interact with www.toastycoin.com without having to setup Metamask, but because metamascara defaults to network 4, I can't fetch mainnet data. Is there a way to specify via the api to use the mainnet?

Android support ? (chrome/firefox for android/ios)

even after successfully installing metamask as a service worker in chrome for android, applications using web3 with MM as the provider still can't interact with wallet.metamask.io (ex: no "popup" or something is opened in the browser on web3.sendTransaction()), whereas it is working in the desktop browser...

Any input on this one? Thank you for your feedback

How to distinguish between locked and no account ?

The common way to check if a account is unlocked in Metamask is a async call to this.web3.eth.getAccounts() and then check if accounts[0] is set.

In Mascara this works fine too. But I son't see how to differentiate between a existing, locked account and a user who never created an account at wallet.metamask.io.

So I can't decide if I should ask the interacting user to unlock or create an account.
If the popup is loaded, it becomes clear, but it would be great if I can differentiate between unlock you account and create a new account at the button triggering the popup.

Chrome Extension

Is this possible to use in a Chrome Extension v3, to have the user login with metamask?

I do not get any popup

I managed to send a transaction via mascara but I had to go to a new tab to zero.metamask.io and accept the transaction there since there was no popup coming up on the dapp page.

How is this secure?

MetaMask Mascara installs a serviceworker on some domain. Can't that domain simply change the service worker, and/or get the private keys? Are they non-extractable, is that why it works?

Cipher private keys

Add the ability to cipher all private keys with (the same for all keys) password. It is to make harder to obtain funds if the computer is stolen.

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

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!

Difficulty running the example

I’ve been trying to get this running and facing some difficulties. The first was that the default host path was zero.metamask.io so i raised this PR #8

After using the override function, I wasn't able to get the mascara UI appearing. When the injector runs, it fails to start the service worker - possibly due to background.js being quite large? The UI popup happens however it also fails as the service worker wasn't running. I created this codepen to demonstrate: https://codepen.io/anon/pen/ZaWNoy

It would be really good if we could have a live demo to try out

incognito window make mascara throw an exception

I get the following exception when using mascara as provider in a incognito window (chrome) :

Uncaught (in promise) DOMException: Failed to register a ServiceWorker: The request to fetch the script was interrupted. (file : proxy.js)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.