mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Allow page injection to look for cross-browser APIs appropriately
This commit is contained in:
parent
5476cb9a2c
commit
f3ea891e72
@ -11,7 +11,8 @@ if (shouldInjectWeb3()) {
|
|||||||
function setupInjection(){
|
function setupInjection(){
|
||||||
// inject in-page script
|
// inject in-page script
|
||||||
var scriptTag = document.createElement('script')
|
var scriptTag = document.createElement('script')
|
||||||
scriptTag.src = extension.extension.getURL('scripts/inpage.js')
|
var urlGetter = extension.extension || chrome.extension
|
||||||
|
scriptTag.src = urlGetter.getURL('scripts/inpage.js')
|
||||||
scriptTag.onload = function () { this.parentNode.removeChild(this) }
|
scriptTag.onload = function () { this.parentNode.removeChild(this) }
|
||||||
var container = document.head || document.documentElement
|
var container = document.head || document.documentElement
|
||||||
// append as first child
|
// append as first child
|
||||||
|
Loading…
Reference in New Issue
Block a user