diff --git a/common/features/store.ts b/common/features/store.ts index 359378fa..b41f0784 100644 --- a/common/features/store.ts +++ b/common/features/store.ts @@ -91,6 +91,9 @@ window.addEventListener('load', () => { }); }); -setInterval(handleMetaMaskPolling.bind(null, store), METAMASK_POLLING_INTERVAL); +/** @desc When MetaMask is loaded as an extension, watch for network changes. */ +if ((window as any).web3) { + setInterval(handleMetaMaskPolling.bind(null, store), METAMASK_POLLING_INTERVAL); +} export default store; diff --git a/common/index.html b/common/index.html index cac71d94..816d698f 100644 --- a/common/index.html +++ b/common/index.html @@ -4,6 +4,7 @@ MyCrypto + @@ -12,7 +13,7 @@ - + @@ -73,4 +74,4 @@ - + \ No newline at end of file diff --git a/webpack_config/makeConfig.js b/webpack_config/makeConfig.js index d9304990..73b2c4bc 100644 --- a/webpack_config/makeConfig.js +++ b/webpack_config/makeConfig.js @@ -166,7 +166,10 @@ module.exports = function(opts = {}) { twitter: { site: config.twitter.creator, creator: config.twitter.creator - } + }, + metaCsp: options.isProduction + ? "default-src 'none'; script-src 'self'; worker-src 'self' blob:; style-src 'self' 'unsafe-inline'; manifest-src 'self'; font-src 'self'; img-src 'self' data: https://shapeshift.io; connect-src *;" + : "" }), new CopyWebpackPlugin([