Use jsbeautifier from pip

This commit is contained in:
dufferzafar 2016-07-26 00:58:09 -07:00
parent d97fe767dc
commit 303b6df447
2 changed files with 3 additions and 2 deletions

View File

@ -31,7 +31,7 @@ from PIL import Image
from six import BytesIO
from mitmproxy import exceptions
from mitmproxy.contrib import jsbeautifier
import jsbeautifier
from mitmproxy.contrib.wbxml import ASCommandResponse
from netlib import http
from netlib import multidict
@ -398,7 +398,7 @@ class ViewJavaScript(View):
def __call__(self, data, **metadata):
opts = jsbeautifier.default_options()
opts.indent_size = 2
res = jsbeautifier.beautify(data, opts)
res = jsbeautifier.beautify(data.decode(), opts)
return "JavaScript", format_text(res)

View File

@ -111,6 +111,7 @@ setup(
],
'contentviews': [
"cssutils>=1.0.1, <1.1",
"jsbeautifier>=1.6.3"
# TODO: Find Python 3 replacements
# "protobuf>=2.6.1, <2.7",
# "pyamf>=0.8.0, <0.9",