Created
July 4, 2013 20:10
-
-
Save pyalot/5929967 to your computer and use it in GitHub Desktop.
Masking javascript globals
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
maskEval = (src) -> | |
whitelist = ['Math', 'performance'] | |
names = [] | |
for name of window | |
if name not in whitelist | |
names.push name | |
names = names.join(',') | |
return eval("(function(){var #{names};return #{src};})").call({}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment