diff --git a/src/inpage/inpage.ts b/src/inpage/inpage.ts index d79e65b2405..f9eb5bf11d8 100644 --- a/src/inpage/inpage.ts +++ b/src/inpage/inpage.ts @@ -305,13 +305,22 @@ try { get: () => warnAboutDeprecatedProvider(provider), set: () => {}, }); +} catch (e) {} + +try { Object.defineProperty(window, 'HiroWalletProvider', { get: () => warnAboutDeprecatedProvider(provider), set: () => {}, }); - Object.defineProperty(window, 'LeatherProvider', { get: () => provider, set: () => {} }); } catch (e) {} +try { + Object.defineProperty(window, 'LeatherProvider', { get: () => provider, set: () => {} }); +} catch (e) { + // eslint-disable-next-line no-console + console.warn('Unable to set LeatherProvider'); +} + // Legacy product provider objects if (typeof window.btc === 'undefined') { (window as any).btc = warnAboutDeprecatedProvider(provider);