├── .npmignore ├── .nvmrc ├── .gitattributes ├── .circleci ├── scripts │ ├── deps-install.sh │ └── collect-har-artifact.sh └── config.yml ├── .github └── CODEOWNERS ├── .eslintrc.js ├── README.md ├── LICENSE ├── package.json ├── .gitignore ├── src └── contentscript.js └── yarn.lock /.npmignore: -------------------------------------------------------------------------------- 1 | * 2 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | v10 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.circleci/scripts/deps-install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -x 4 | set -e 5 | set -u 6 | set -o pipefail 7 | 8 | yarn --frozen-lockfile --ignore-scripts --har 9 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Lines starting with '#' are comments. 2 | # Each line is a file pattern followed by one or more owners. 3 | 4 | * @MetaMask/extension-devs 5 | -------------------------------------------------------------------------------- /.circleci/scripts/collect-har-artifact.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -x 4 | set -e 5 | set -u 6 | set -o pipefail 7 | 8 | mkdir -p build-artifacts/yarn-install-har 9 | mv ./*.har build-artifacts/yarn-install-har/ 10 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | parserOptions: { 3 | ecmaVersion: 2018, 4 | sourceType: 'module', 5 | }, 6 | extends: [ 7 | '@metamask/eslint-config', 8 | '@metamask/eslint-config/config/nodejs', 9 | ], 10 | plugins: [ 11 | 'json', 12 | ], 13 | globals: { 14 | window: true, 15 | document: true, 16 | }, 17 | rules: { 18 | 'import/unambiguous': 'off', 19 | 'import/extensions': 'off', 20 | 'import/no-unassigned-import': 'off', 21 | 'node/no-sync': 'off', 22 | }, 23 | ignorePatterns: [ 24 | '!.eslintrc.js', 25 | 'node_modules/', 26 | 'dist/', 27 | 'build/temp', 28 | ], 29 | } 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # legacy-web3-extension 2 | 3 | An extension that adds MetaMask's legacy `window.web3` API to your browser. 4 | 5 | ## Usage 6 | 7 | 1. `yarn install` 8 | 2. `yarn build` 9 | 3. Load the unpacked extension from `dist/unpacked/YOUR_FAVORITE_BROWSER` 10 | 4. Test with any build of the MetaMask Extension, version [9.0.1]() and later 11 | 12 | ### Dependencies 13 | 14 | The extension's content script contains the [minified source](https://unpkg.com/@metamask/legacy-web3@2.0.0/dist/metamask.web3.min.js) of this dependency as a string literal in order to inject it into web pages as a `