This represents a command passed as an argument. Also split arguments from
command values themselves, making the command help for meta-commands much
clearer.
We previously had the problem that overriding keypress() skipped
the proper calculation of the top widget's size, leading to broken
scrolling behavior in the flowlist. We now always use urwid.Frame's
keypress method, but we make sure that urwid.Pile and urwid.Columns
delegate to the currently focused component.
This makes it possible to specify more specific type annotations at runtime,
so that both mypy and our command system are happy. The .argument(name, type=)
syntax is similar to click's, so it should be fairly extensible if we need it.
This resolves as a string during MyPy checks, but at runtime has an additional
attribute that is a command that returns valid options.
This is very ugly and clumsy, basically because MyPy is super restrictive about
what it accepts as a type. Almost any attempt to construct these types in a
more sophisticated way fails in one way or another. I'm open to suggestions.
We now have:
console.flowview.mode gets the current mode
console.flowview.mode.options gets the possible options for the mode
console.flowview.mode.set sets the flowview mode
This is quite a common pattern in our commands, to the point where we should
formalise it.
Fixes#2655
A simple addon that starts an instance of Chrome attached to the current
proxy. The instance is isolated in its own user data directory, and addons are
turned off.
Future work:
- I wasn't able to test the Windows executable path - a Windows dev should
confirm this for us.
- In future it would be nice to support other browsers like Firefox.
- always refresh UI after flow is finished (refs #2616)
- count currently active replay
- make replay thread daemonic so that users can exit mitmproxy
if replay hangs. This is not perfect yet, but vastly better
than how it has been.