1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-23 03:36:18 +02:00
Commit Graph

95 Commits

Author SHA1 Message Date
Mark Stacey
2ceac1f27f Add warning about reload on network change
We are soon removing the automatic refresh on network change behavior.
A warning has been added to ensure sites know about this upcoming
change.

Any site that calls `.enable` is advised to use a
`networkChanged` event handler to reload manually if they rely upon
that behavior. They are also advised to set the flag
`autoRefreshOnNetworkChange` to `false` to opt-out of the reload
behavior early.

This warning might be irritating for certain sites, as they might be
indifferent to whether or not the site reloads, and not eager to set a
flag to opt-in early just to silence the warning. However there was no
other obvious way to warning the right people about this change, as
any warning prior to an actual reload would only be seen by the few
people that set their browser console to preserve logs.

Relates to #3599
2019-08-21 14:14:35 -03:00
Mark Stacey
32fffe53f5
Remove Drizzle tests (#6855)
The Drizzle tests have not been used for some time. They were used to
ensure compatibility with newer versions of `web3` v1. If we want to
re-add tests to ensure compatibility with newer `web3` versions, we
should find some way of doing that more reliably than was done here -
these tests were somewhat flaky and unreliable.
2019-07-15 17:10:46 -03:00
Mark Stacey
95f198550e
Declare variables before use (#6806)
While working on #6805, I noticed that many variables were being used
before they were declared. Technically this worked fine in practice
because we were using the `transform-es2015-block-scoping` Babel plugin,
which transforms `let` and `const` to `var`, which is hoisted. However,
after removing that Babel transformation, many things broke.

All instances of variables or classes being used before declared have
been fixed.

The `no-use-before-define` eslint rule has been added to catch these
cases going forward. The rule is disabled for function declarations for
the moment, because those are always hoisted. We could disable that too
if we want to, but it's purely stylistic and would require a lot more
changes.
2019-07-05 14:01:34 -03:00
bitpshr
e8f6dff0be bugfix: reject enable promise on user rejection 2019-05-31 16:07:58 -04:00
kumavis
2845398c3d Refactor ProviderApprovalController to use rpc and publicConfigStore (#6410)
* Ensure home screen does not render if there are unapproved txs (#6501)

* Ensure that the confirm screen renders before the home screen if there are unapproved txs.

* Only render confirm screen before home screen on mount.

* inpage - revert _metamask api to isEnabled isApproved isUnlocked
2019-05-03 13:32:05 -04:00
Sneh Koul
6a60562d66 Opens the original webpage from where installation of MetaMask was re… (#6272)
* Opens the original webpage from where installation of MetaMask was requested

* Asking for dynamic permissions

* code for forwarder/without extra permissions

* Lint fix for onboardingComplete message sending code.
2019-04-24 10:49:38 -07:00
Josh Stevens
2aaec1d9fb Stop reloading dapps on network change allowing dapps to decide if it should refresh or not (#6330)
* feat: `inpageProvider.autoRefreshOnNetworkChange` to allow dapps to control if it refreshes or not

* feat: check the `autoRefreshOnNetworkChange` before a refresh

* fix linting error

* fix: use `window.ethereum` now `web3.ethereum`
2019-03-21 12:42:23 -07:00
Paul Bouchon
2f7d449427 EIP-1193: standard provider API (#6170)
* EIP-1193: Implement new provider API

* EIP-1193: Updated implementation

* Remove test file

* Fix tests

* Update ping check

* Update logic

* PR feedback
2019-02-19 16:42:08 -08:00
Graham Kaemmer
89c4353408 Fix inpage.js event handler memory leak (#6177)
Fixes #6176
2019-02-18 16:07:58 -05:00
Whymarrh Whitby
f5eb1512d4 Fix all "var used instead of let or const" problems in inpage.js 2019-02-12 10:36:15 -03:30
Paul Bouchon
7fe37276a1
1102: Push publicConfigStore to next turn to avoid race conditiono (#5777) 2018-11-18 07:23:04 -05:00
Whymarrh Whitby
1988e1e96b ESLint fixes (#5775)
* eslint . --fix

* Upgrade all ESLint warnings to errors
2018-11-16 14:54:55 -10:00
Paul Bouchon
c317624854 EIP-1102: Update publicConfig store concurrently with approval 2018-11-09 18:21:59 -08:00
Noah I
8bed073f20 1102: Fix inpage listener syntax (#5708) (#5709) 2018-11-09 07:14:32 -05:00
bitpshr
718393f89a Cleanup 2018-11-07 08:47:25 -08:00
bitpshr
a224b71837 1102: use postMessage instead of injected scripts to bypass CSP 2018-11-07 08:47:25 -08:00
bitpshr
1ce3591c8e wip 2018-11-07 08:47:25 -08:00
bitpshr
b3f428fd1f Move experimental provider augmentation 2018-11-05 15:07:09 -08:00
bitpshr
879997af51 Add experimental RPC method support 2018-11-05 15:07:09 -08:00
bitpshr
9984f7edeb Mark origins as unapproved if user explicitly locks MetaMask 2018-11-05 15:07:09 -08:00
bitpshr
991e08e346 isApproved should return false 2018-11-05 15:07:09 -08:00
bitpshr
72730b3929 Remove internal listeners 2018-11-05 15:07:09 -08:00
bitpshr
cc27a09a1a rebase 2018-11-05 15:07:09 -08:00
bitpshr
d4171ccea5 Disable approval caching 2018-11-05 15:07:09 -08:00
bitpshr
cc1bab6ebb Differentiate locked and enabled 2018-11-05 15:07:09 -08:00
bitpshr
d7618bd5c6 Code bath 2018-11-05 15:07:09 -08:00
bitpshr
ba40fcbcb4 Handle logout gracefully 2018-11-05 15:07:09 -08:00
bitpshr
f35466a247 Fix race condition with publicConfigStore 2018-11-05 15:07:09 -08:00
bitpshr
32630b68df Move convenience methods to _metamask namespace 2018-11-05 15:07:09 -08:00
bitpshr
84874a639d Add isUnlocked provider hook 2018-11-05 15:07:09 -08:00
bitpshr
573139b935 Differentiate isEnabled and isApproved hook 2018-11-05 15:07:09 -08:00
bitpshr
3a2ade4e84 Update isEnabled check 2018-11-05 15:07:09 -08:00
bitpshr
226601a956 EIP-1102: add user privacy option 2018-11-05 15:07:09 -08:00
bitpshr
bfcb73ad53 EIP-1102: add isEnabled convenience method to provider 2018-11-05 15:07:09 -08:00
bitpshr
89b4aa5d62 EIP-1102: Add option to force-enable provider 2018-11-05 15:07:09 -08:00
bitpshr
c76c9ca2c8 EIP-1102: updated implementation 2018-11-05 15:07:09 -08:00
kumavis
fa36dbf981 inpage - increase provider max listeners to avoid warnings 2018-10-17 19:17:39 -04:00
kumavis
45feb43f30 workaround - fix for drizzle 2018-10-08 16:54:13 -04:00
Paul Bouchon
9359fc875d
EIP-1102: Add deprecation message (#5353) 2018-09-26 10:48:17 -04:00
Paul Bouchon
2ec09362c5
EIP-1102: Transitionary API (#5256) 2018-09-14 19:26:03 -04:00
Dan Finlay
6ce119d1fb Move inpage-provider and port-stream outside
With the creation of the [metamask-extension-provider](https://github.com/MetaMask/metamask-extension-provider) we have our first non-core module that is dependent on the inpage-provider and port-stream.

To reduce the size of its dependencies, I have moved the
[metamask-inpage-provider](https://github.com/MetaMask/metamask-inpage-provider) into its own module, as well as [extension-port-stream](https://github.com/MetaMask/extension-port-stream).

This allows them to be more easily depended & iterated on by external
projects.
2018-08-20 15:45:50 -07:00
Dan Finlay
3a6cc3c8fd Re-enable dapp reload on network change
We want to give devs some time to digest [this blog post](https://medium.com/metamask/breaking-change-no-longer-reloading-pages-on-network-change-4a3e1fd2f5e7) before we making a breaking change to our platform.

Makes it easy to re-implement the change.
2018-06-14 15:15:23 -07:00
Erik Marks
b982961381 removed auto-reload.js, moved global web3 export to inpage.js 2018-06-12 11:04:37 -07:00
Erik Marks
f461bd8812 wip 2018-06-12 09:28:50 -07:00
bitpshr
1ef6528921 Add JSDoc to various background scripts 2018-04-18 21:30:13 -04:00
bitpshr
c9f83fe8bc Add JSDoc to various background scripts 2018-04-18 17:02:08 -04:00
bitpshr
7129d7c0f3 Require loglevel singleton in each module that uses it 2018-04-13 17:56:28 -04:00
kumavis
00657e14a8 build - correctly set METAMASK_ENV via envify 2018-04-03 09:51:33 -07:00
Dan Finlay
5ce94e69b3 Add useful error when duplicate web3 is detected.
Fixes #2507
2017-10-31 09:59:26 -07:00
Kevin Serrano
b9bbf8f329
Resolving that ugly merge. 2017-10-25 15:45:26 -07:00