diff --git a/app/scripts/background.js b/app/scripts/background.js index 7828c6d80..7c347d62e 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -391,7 +391,10 @@ function setupController (initState, initLangCode) { // communication with page or other extension function connectExternal (remotePort) { const senderUrl = new URL(remotePort.sender.url) - const extensionId = remotePort.sender.id + let extensionId + if (remotePort.sender.id !== extension.runtime.id) { + extensionId = remotePort.sender.id + } const portStream = new PortStream(remotePort) controller.setupUntrustedCommunication(portStream, senderUrl, extensionId) } diff --git a/app/scripts/controllers/provider-approval.js b/app/scripts/controllers/provider-approval.js index 3ece07e13..00ff626f7 100644 --- a/app/scripts/controllers/provider-approval.js +++ b/app/scripts/controllers/provider-approval.js @@ -47,7 +47,8 @@ class ProviderApprovalController extends SafeEventEmitter { if (extensionId) { metadata.extensionId = extensionId } else { - Object.assign(metadata, await getSiteMetadata(origin)) + const siteMetadata = await getSiteMetadata(origin) + Object.assign(metadata, { siteTitle: siteMetadata.name, siteImage: siteMetadata.icon}) } this._handleProviderRequest(metadata) // wait for resolution of request diff --git a/ui/app/pages/provider-approval/provider-approval.component.js b/ui/app/pages/provider-approval/provider-approval.component.js index da177defc..8532fe60d 100644 --- a/ui/app/pages/provider-approval/provider-approval.component.js +++ b/ui/app/pages/provider-approval/provider-approval.component.js @@ -6,7 +6,13 @@ export default class ProviderApproval extends Component { static propTypes = { approveProviderRequestByOrigin: PropTypes.func.isRequired, rejectProviderRequestByOrigin: PropTypes.func.isRequired, - providerRequest: PropTypes.object.isRequired, + providerRequest: PropTypes.exact({ + hostname: PropTypes.string.isRequired, + siteImage: PropTypes.string, + siteTitle: PropTypes.string, + origin: PropTypes.string.isRequired, + extensionId: PropTypes.string, + }).isRequired, }; static contextTypes = { @@ -20,7 +26,6 @@ export default class ProviderApproval extends Component { approveProviderRequestByOrigin={approveProviderRequestByOrigin} rejectProviderRequestByOrigin={rejectProviderRequestByOrigin} origin={providerRequest.origin} - tabID={providerRequest.tabID} siteImage={providerRequest.siteImage} siteTitle={providerRequest.siteTitle} hostname={providerRequest.hostname}