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 Support IPNS address translations (#8502) 2020-05-14 07:56:27 -02:30
migrator Move default export declaration to Migrator class (#8407) 2020-04-26 00:02:41 -02:30
account-tracker.js Cleanup network enums (#8627) 2020-05-20 08:57:45 -07:00
auto-reload.js Define global web3 as non-enumerable (#8634) 2020-05-20 20:18:25 -07:00
backend-metametrics.js Move export defaults statements alongside their objects (#8525) 2020-05-05 19:49:38 -02:30
buy-eth-url.js Move export defaults statements alongside their objects (#8525) 2020-05-05 19:49:38 -02:30
cleanErrorStack.js Move export defaults statements alongside their objects (#8525) 2020-05-05 19:49:38 -02:30
ComposableObservableStore.js Move export defaults statements alongside their objects (#8525) 2020-05-05 19:49:38 -02:30
createLoggerMiddleware.js Move export defaults statements alongside their objects (#8525) 2020-05-05 19:49:38 -02:30
createOnboardingMiddleware.js Move export defaults statements alongside their objects (#8525) 2020-05-05 19:49:38 -02:30
createOriginMiddleware.js Move export defaults statements alongside their objects (#8525) 2020-05-05 19:49:38 -02:30
createStreamSink.js Move export defaults statements alongside their objects (#8525) 2020-05-05 19:49:38 -02:30
createTabIdMiddleware.js Move export defaults statements alongside their objects (#8525) 2020-05-05 19:49:38 -02:30
decrypt-message-manager.js Implementation encrypt/decrypt feature (#7831) 2020-02-19 14:24:16 -04:00
encryption-public-key-manager.js LoginPerSite: Support multiple accounts without automatic switching (#8079) 2020-03-06 13:34:56 -08:00
enums.js Cleanup network enums (#8627) 2020-05-20 08:57:45 -07:00
extractEthjsErrorMessage.js Move export defaults statements alongside their objects (#8525) 2020-05-05 19:49:38 -02:30
fetch-with-timeout.js Prevent accidental use of globals (#8340) 2020-04-15 14:23:27 -03:00
freezeGlobals.js Consistent jsdoc syntax (#7755) 2020-01-13 14:36:36 -04:00
get-first-preferred-lang-code.js Move export defaults statements alongside their objects (#8525) 2020-05-05 19:49:38 -02:30
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 Enable arrow-parens ESLint rule 2020-02-15 17:04:21 -03:30
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 Remove unused NotificationManager#closePopup (#8530) 2020-05-05 21:02:29 -02:30
personal-message-manager.js Enable arrow-parens ESLint rule 2020-02-15 17:04:21 -03:30
random-id.js Move export defaults statements alongside their objects (#8525) 2020-05-05 19:49:38 -02:30
reportFailedTxToSentry.js Move export defaults statements alongside their objects (#8525) 2020-05-05 19:49:38 -02:30
seed-phrase-verifier.js Consistent jsdoc syntax (#7755) 2020-01-13 14:36:36 -04:00
select-chain-id.js Cleanup network enums (#8627) 2020-05-20 08:57:45 -07:00
setupFetchDebugging.js Move export defaults statements alongside their objects (#8525) 2020-05-05 19:49:38 -02:30
setupSentry.js Move export defaults statements alongside their objects (#8525) 2020-05-05 19:49:38 -02:30
stream-utils.js Consistent jsdoc syntax (#7755) 2020-01-13 14:36:36 -04:00
typed-message-manager.js Enable arrow-parens ESLint rule 2020-02-15 17:04:21 -03:30
util.js Delete unused util functions (#8622) 2020-05-20 10:36:41 -02:30