mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 18:00:18 +01:00
inpage - add try/catch to cleanContextForImports
This commit is contained in:
parent
5b895c2a22
commit
9101812552
@ -53,9 +53,17 @@ var __define
|
||||
|
||||
function cleanContextForImports () {
|
||||
__define = global.define
|
||||
delete global.define
|
||||
try {
|
||||
delete global.define
|
||||
} catch (_) {
|
||||
console.warn('MetaMask - global.define could not be deleted.')
|
||||
}
|
||||
}
|
||||
|
||||
function restoreContextAfterImports () {
|
||||
global.define = __define
|
||||
try {
|
||||
global.define = __define
|
||||
} catch {
|
||||
console.warn('MetaMask - global.define could not be overwritten.')
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user