Remove injected script tags after use

feature/default_network_editable
bitpshr 6 years ago
parent 34d80f21e2
commit d7b1cacabc
  1. 2
      app/scripts/contentscript.js

@ -37,8 +37,10 @@ function injectScript (content) {
try { try {
const container = document.head || document.documentElement const container = document.head || document.documentElement
const scriptTag = document.createElement('script') const scriptTag = document.createElement('script')
scriptTag.setAttribute('async', false)
scriptTag.textContent = content scriptTag.textContent = content
container.insertBefore(scriptTag, container.children[0]) container.insertBefore(scriptTag, container.children[0])
container.removeChild(scriptTag)
} catch (e) { } catch (e) {
console.error('MetaMask script injection failed', e) console.error('MetaMask script injection failed', e)
} }

Loading…
Cancel
Save