Last active
June 1, 2022 06:28
-
-
Save matzeeable/fe9f40b19bb1e9b3e21232fb4059f69c to your computer and use it in GitHub Desktop.
Restore function from overriden polyfill (ES5)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function restoreNativeFunctionFromPolyfillOverride(callback) { | |
var d = document; | |
var dE = d.documentElement; | |
var e = d.createElement("iframe"); | |
e.style.display = "none"; | |
dE.appendChild(e); | |
callback(window, e.contentWindow); | |
dE.removeChild(e); | |
} | |
restoreNativeFunctionFromPolyfillOverride(function(w, c) { | |
w.Array.from = c.Array.from; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment