Skip to content
This repository has been archived by the owner on Aug 22, 2022. It is now read-only.

A polyfill drop-in script that provides a web3 and ethereum object on the window when the window is embedded in an iframe

License

Notifications You must be signed in to change notification settings

ethvault/iframe-provider-polyfill

Repository files navigation

ethvault/iframe-provider-polyfill

Build Status MinZipped size NPM Version

This is a drop in script that overrides web3 to point at the parent window when the page is embedded in an iframe. This makes the dapp instantly compatible with Ethvault if it works with MetaMask.

Browsers only

This polyfill is meant for browser contexts only. The import is no-op in node contexts.

Usage

Install the dependency

npm i @ethvault/iframe-provider-polyfill

or with yarn:

yarn add @ethvault/iframe-provider-polyfill

Then import it into your index.js

import '@ethvault/iframe-provider-polyfill';

Or use a CDN like unpkg. Use subresource integrity, to prevent security vulnerabilities.

(v0.1.5)

<script src="https://unpkg.com/@ethvault/iframe-provider-polyfill@0.1.5/dist/index.js" integrity="sha384-qx1eG3ocmrXxXBwEL+qnP7je980Depwy/J7keRHVnqfEFVXHJ0ruzYIsUX767NEH" crossorigin="anonymous"></script>

About

A polyfill drop-in script that provides a web3 and ethereum object on the window when the window is embedded in an iframe

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published