1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00
metamask-extension/app/scripts/lib
Mark Stacey 9e2e353a24
Define global web3 as non-enumerable (#8634)
We inject `web3` globally on most websites. This has been breaking
websites that attempted to serialize the `window` object, because any
attempt to access certain `web3` properties (such as `web3.eth.mining`)
would throw an error. This is because `web3` defined a getter for these
properties that would call `.send([method])`, which doesn't work for
most methods.

An example of a site that this breaks is `Storybook`, when the
`@storybook/addon-actions` addon is being used. When using storybook
with this addon and with the MetaMask extension installed, actions
would not be properly dispatched because an error would be thrown in
the attempt to serialize the event (which includes a reference to the
`window`).

The `web3` global we inject is now defined as non-enumerable, so it
will be skipped automatically in any attempt to serialize the `window`
object.
2020-05-20 20:18:25 -07:00
..
ens-ipfs
migrator
account-tracker.js
auto-reload.js
backend-metametrics.js
buy-eth-url.js
cleanErrorStack.js
ComposableObservableStore.js
createLoggerMiddleware.js Move export defaults statements alongside their objects (#8525) 2020-05-05 19:49:38 -02:30
createOnboardingMiddleware.js
createOriginMiddleware.js
createStreamSink.js
createTabIdMiddleware.js
decrypt-message-manager.js
encryption-public-key-manager.js LoginPerSite: Support multiple accounts without automatic switching (#8079) 2020-03-06 13:34:56 -08:00
enums.js
extractEthjsErrorMessage.js
fetch-with-timeout.js
freezeGlobals.js Consistent jsdoc syntax (#7755) 2020-01-13 14:36:36 -04:00
get-first-preferred-lang-code.js
getObjStructure.js Move export defaults statements alongside their objects (#8525) 2020-05-05 19:49:38 -02:30
local-store.js Consistent jsdoc syntax (#7755) 2020-01-13 14:36:36 -04:00
message-manager.js
network-store.js Move export defaults statements alongside their objects (#8525) 2020-05-05 19:49:38 -02:30
nodeify.js Consistent jsdoc syntax (#7755) 2020-01-13 14:36:36 -04:00
notification-manager.js
personal-message-manager.js Enable arrow-parens ESLint rule 2020-02-15 17:04:21 -03:30
random-id.js
reportFailedTxToSentry.js
seed-phrase-verifier.js
select-chain-id.js
setupFetchDebugging.js
setupSentry.js
stream-utils.js Consistent jsdoc syntax (#7755) 2020-01-13 14:36:36 -04:00
typed-message-manager.js
util.js