mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
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.
This commit is contained in:
parent
d9a27fcf52
commit
b25f4bbe4a
@ -83,7 +83,7 @@ async function queryCurrentActiveTab (windowType) {
|
||||
|
||||
extension.tabs.query({ active: true, currentWindow: true }, (tabs) => {
|
||||
const [activeTab] = tabs
|
||||
const { title, url } = activeTab
|
||||
const { id, title, url } = activeTab
|
||||
const { origin, protocol } = url ? new URL(url) : {}
|
||||
|
||||
if (!origin || origin === 'null') {
|
||||
@ -91,7 +91,7 @@ async function queryCurrentActiveTab (windowType) {
|
||||
return
|
||||
}
|
||||
|
||||
resolve({ title, origin, protocol, url })
|
||||
resolve({ id, title, origin, protocol, url })
|
||||
})
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user