Skip to content

Commit

Permalink
Support in the browser.
Browse files Browse the repository at this point in the history
  • Loading branch information
zswang committed Jan 20, 2016
1 parent 0bb275c commit 0722a2b
Show file tree
Hide file tree
Showing 7 changed files with 795 additions and 682 deletions.
3 changes: 3 additions & 0 deletions .bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory": "bower_components"
}
33 changes: 33 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "jfogs",
"version": "0.0.13",
"description": "Javascript code obfuscator",
"main": "./lib/jfogs.js",
"authors": {
"name": "zswang",
"url": "http://weibo.com/zswang"
},
"moduleType": [
"globals",
"node"
],
"keywords": [
"code",
"obfuscator"
],
"license": "MIT",
"dependencies": {
"esprima": "2.0.0"
},
"ignore": [
"debug",
"src",
"version.js",
"**/.*",
"node_modules",
"bower_components",
"app/components",
"test",
"tests"
]
}
31 changes: 31 additions & 0 deletions examples/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html>
<head>
<title>jfogs example</title>
<style>
textarea {
width: 100%;
}
</style>
</head>
<body>
<div>
<input type="button" value="obfuscate">
</div>
<textarea rows="20">console.log(/\w/img.test('hello'));</textarea>
<textarea rows="20"></textarea>
</body>
<script src="../bower_components/esprima/esprima.js"></script>
<script src="../lib/jfogs.js"></script>
<script>
(function () {
var textareaInput = document.querySelector('textarea:nth-of-type(1)');
var textareaOutput = document.querySelector('textarea:nth-of-type(2)');
document.querySelector('input[type=button]').addEventListener('click', function () {
textareaOutput.value = jfogs.obfuscate(textareaInput.value, {
type: 'zero'
});
});
})();
</script>
</html>
Loading

0 comments on commit 0722a2b

Please sign in to comment.