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.
ultimately we probably want to open the options editor immediately if someone presses "Options".
This still requires us to
1. have a nicer editors for common settings.
2. Add a "view event log" button somewhere else,
for example in the footer.
For now, the options editor is marked as beta, as there are some options you
clearly do not want to edit (e.g. wfile).