mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Remove injected script tags after use
This commit is contained in:
parent
34d80f21e2
commit
d7b1cacabc
@ -37,8 +37,10 @@ function injectScript (content) {
|
||||
try {
|
||||
const container = document.head || document.documentElement
|
||||
const scriptTag = document.createElement('script')
|
||||
scriptTag.setAttribute('async', false)
|
||||
scriptTag.textContent = content
|
||||
container.insertBefore(scriptTag, container.children[0])
|
||||
container.removeChild(scriptTag)
|
||||
} catch (e) {
|
||||
console.error('MetaMask script injection failed', e)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user