aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mitmproxy/addons/dumper.py7
-rw-r--r--mitmproxy/options.py7
-rw-r--r--mitmproxy/tools/console/consoleaddons.py7
-rw-r--r--mitmproxy/tools/console/statusbar.py4
-rw-r--r--test/mitmproxy/tools/console/test_statusbar.py2
5 files changed, 15 insertions, 12 deletions
diff --git a/mitmproxy/addons/dumper.py b/mitmproxy/addons/dumper.py
index 8cfacde6..0df2d339 100644
--- a/mitmproxy/addons/dumper.py
+++ b/mitmproxy/addons/dumper.py
@@ -42,6 +42,11 @@ class Dumper:
3: 2 + full response content, content of WebSocket and TCP messages.
"""
)
+ loader.add_option(
+ "dumper_default_contentview", str, "auto",
+ "The default content view mode.",
+ choices = [i.name.lower() for i in contentviews.views]
+ )
def configure(self, updated):
if "view_filter" in updated:
@@ -73,7 +78,7 @@ class Dumper:
def _echo_message(self, message):
_, lines, error = contentviews.get_message_content_view(
- ctx.options.default_contentview,
+ ctx.options.dumper_default_contentview,
message
)
if error:
diff --git a/mitmproxy/options.py b/mitmproxy/options.py
index 05332b3f..39fbff8f 100644
--- a/mitmproxy/options.py
+++ b/mitmproxy/options.py
@@ -1,7 +1,6 @@
from typing import Optional, Sequence
from mitmproxy import optmanager
-from mitmproxy import contentviews
from mitmproxy.net import tls
log_verbosity = [
@@ -57,7 +56,6 @@ class Options(optmanager.OptManager):
# FIXME: Options that must be migrated to addons, but are complicated
# because they're used by more than one addon, or because they're
# embedded in the core code somehow.
- default_contentview = None # type: str
proxyauth = None # type: Optional[str]
showhost = None # type: bool
verbosity = None # type: str
@@ -78,11 +76,6 @@ class Options(optmanager.OptManager):
"Log verbosity.",
choices=log_verbosity
)
- self.add_option(
- "default_contentview", str, "auto",
- "The default content view mode.",
- choices = [i.name.lower() for i in contentviews.views]
- )
# Proxy options
self.add_option(
diff --git a/mitmproxy/tools/console/consoleaddons.py b/mitmproxy/tools/console/consoleaddons.py
index 9856e80f..939757d7 100644
--- a/mitmproxy/tools/console/consoleaddons.py
+++ b/mitmproxy/tools/console/consoleaddons.py
@@ -77,6 +77,11 @@ class ConsoleAddon:
def load(self, loader):
loader.add_option(
+ "console_default_contentview", str, "auto",
+ "The default content view mode.",
+ choices = [i.name.lower() for i in contentviews.views]
+ )
+ loader.add_option(
"console_layout", str, "single",
"Console layout.",
choices=sorted(console_layouts),
@@ -531,7 +536,7 @@ class ConsoleAddon:
[
"@focus",
"flowview_mode_%s" % idx,
- self.master.options.default_contentview,
+ self.master.options.console_default_contentview,
]
)
diff --git a/mitmproxy/tools/console/statusbar.py b/mitmproxy/tools/console/statusbar.py
index bdb39013..8553a66f 100644
--- a/mitmproxy/tools/console/statusbar.py
+++ b/mitmproxy/tools/console/statusbar.py
@@ -197,10 +197,10 @@ class StatusBar(urwid.WidgetWrap):
r.append("[")
r.append(("heading_key", "u"))
r.append(":%s]" % self.master.options.stickyauth)
- if self.master.options.default_contentview != "auto":
+ if self.master.options.console_default_contentview != "auto":
r.append("[")
r.append(("heading_key", "M"))
- r.append(":%s]" % self.master.options.default_contentview)
+ r.append(":%s]" % self.master.options.console_default_contentview)
if self.master.options.has_changed("view_order"):
r.append("[")
r.append(("heading_key", "o"))
diff --git a/test/mitmproxy/tools/console/test_statusbar.py b/test/mitmproxy/tools/console/test_statusbar.py
index ac17c5c0..db8a63a7 100644
--- a/test/mitmproxy/tools/console/test_statusbar.py
+++ b/test/mitmproxy/tools/console/test_statusbar.py
@@ -14,7 +14,7 @@ def test_statusbar(monkeypatch):
view_filter="~dst example.com",
stickycookie="~dst example.com",
stickyauth="~dst example.com",
- default_contentview="javascript",
+ console_default_contentview="javascript",
anticache=True,
anticomp=True,
showhost=True,