diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-03-25 10:56:45 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-03-25 10:56:45 +1300 |
commit | 2240d2a6a52a4fab966abf31fe03d66de726cf94 (patch) | |
tree | ac59fc38dcd3eb95e76e69c8ef072ccff3cd4118 /libmproxy/contrib/jsbeautifier/unpackers/README.specs.mkd | |
parent | 74c51df5806e98046a1abea72c377781434810d8 (diff) | |
download | mitmproxy-2240d2a6a52a4fab966abf31fe03d66de726cf94.tar.gz mitmproxy-2240d2a6a52a4fab966abf31fe03d66de726cf94.tar.bz2 mitmproxy-2240d2a6a52a4fab966abf31fe03d66de726cf94.zip |
Pretty view now indents Javascript.
Thanks to the JSBeautifier project, which is now included in the contrib directory.
Diffstat (limited to 'libmproxy/contrib/jsbeautifier/unpackers/README.specs.mkd')
-rw-r--r-- | libmproxy/contrib/jsbeautifier/unpackers/README.specs.mkd | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/libmproxy/contrib/jsbeautifier/unpackers/README.specs.mkd b/libmproxy/contrib/jsbeautifier/unpackers/README.specs.mkd new file mode 100644 index 00000000..e937b762 --- /dev/null +++ b/libmproxy/contrib/jsbeautifier/unpackers/README.specs.mkd @@ -0,0 +1,25 @@ +# UNPACKERS SPECIFICATIONS + +Nothing very difficult: an unpacker is a submodule placed in the directory +where this file was found. Each unpacker must define three symbols: + + * `PRIORITY` : integer number expressing the priority in applying this + unpacker. Lower number means higher priority. + Makes sense only if a source file has been packed with + more than one packer. + * `detect(source)` : returns `True` if source is packed, otherwise, `False`. + * `unpack(source)` : takes a `source` string and unpacks it. Must always return + valid JavaScript. That is to say, your code should look + like: + +``` +if detect(source): + return do_your_fancy_things_with(source) +else: + return source +``` + +*You can safely define any other symbol in your module, as it will be ignored.* + +`__init__` code will automatically load new unpackers, without any further step +to be accomplished. Simply drop it in this directory. |