diff --git a/app/scripts/ui.js b/app/scripts/ui.js index a1f904f61..a99da37a0 100644 --- a/app/scripts/ui.js +++ b/app/scripts/ui.js @@ -92,9 +92,9 @@ async function queryCurrentActiveTab (windowType) { extension.tabs.query({active: true, currentWindow: true}, (tabs) => { const [activeTab] = tabs const {title, url} = activeTab - const origin = url ? urlUtil.parse(url).hostname : null + const { hostname: origin, protocol } = url ? urlUtil.parse(url) : {} resolve({ - title, origin, url, + title, origin, protocol, url, }) }) }) diff --git a/ui/app/pages/home/home.container.js b/ui/app/pages/home/home.container.js index 2ef05679d..064c914cd 100644 --- a/ui/app/pages/home/home.container.js +++ b/ui/app/pages/home/home.container.js @@ -11,6 +11,8 @@ import { import { getEnvironmentType } from '../../../../app/scripts/lib/util' import { ENVIRONMENT_TYPE_POPUP } from '../../../../app/scripts/lib/enums' +const activeTabDappProtocols = ['http:', 'https:', 'dweb:', 'ipfs:', 'ipns:', 'ssb:'] + const mapStateToProps = state => { const { activeTab, metamask, appState } = state const { @@ -28,7 +30,12 @@ const mapStateToProps = state => { const accountBalance = getCurrentEthBalance(state) const { forgottenPassword } = appState - const isUnconnected = Boolean(activeTab && privacyMode && !approvedOrigins[activeTab.origin]) + const isUnconnected = Boolean( + activeTab && + activeTabDappProtocols.includes(activeTab.protocol) && + privacyMode && + !approvedOrigins[activeTab.origin] + ) const isPopup = getEnvironmentType(window.location.href) === ENVIRONMENT_TYPE_POPUP return {