Prevent manually connecting to extension UI (#8893)

The `activeTab.id` property is relied upon in the connected sites modal
to prevent the user from manually connecting to the MetaMask extension
itself. Unfortunately the `id` property was never set.

`id` is now set on the `activeTab` state, so manually connecting to the
extension UI is now impossible.
feature/default_network_editable
Mark Stacey 4 years ago committed by GitHub
parent d9a27fcf52
commit b25f4bbe4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      app/scripts/ui.js

@ -83,7 +83,7 @@ async function queryCurrentActiveTab (windowType) {
extension.tabs.query({ active: true, currentWindow: true }, (tabs) => { extension.tabs.query({ active: true, currentWindow: true }, (tabs) => {
const [activeTab] = tabs const [activeTab] = tabs
const { title, url } = activeTab const { id, title, url } = activeTab
const { origin, protocol } = url ? new URL(url) : {} const { origin, protocol } = url ? new URL(url) : {}
if (!origin || origin === 'null') { if (!origin || origin === 'null') {
@ -91,7 +91,7 @@ async function queryCurrentActiveTab (windowType) {
return return
} }
resolve({ title, origin, protocol, url }) resolve({ id, title, origin, protocol, url })
}) })
}) })
} }

Loading…
Cancel
Save