Last active
May 31, 2025 20:11
-
-
Save Integralist/1186328 to your computer and use it in GitHub Desktop.
Access original value of property that has been over-written /via @jdalton and modified by @dperini #js
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() { | |
var hasKey = {}.hasOwnProperty; | |
Object.prototype.hasOwnProperty = 1; | |
delete Object.prototype.hasOwnProperty; | |
var iframe = document.createElement('iframe'); | |
document.documentElement.appendChild(iframe); | |
Object.prototype.hasOwnProperty = window.frames[0].Object.prototype.hasOwnProperty; | |
document.documentElement.removeChild(iframe); | |
alert('value after deleting Object.prototype.hasOwnProperty is: ' + {}.hasOwnProperty); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment