Closed cloud-jie closed 1 year ago
Hi,
Yes, this is a bug in burp suite. See https://github.com/PortSwigger/burp-extensions-montoya-api/issues/19. And it will be fixed.
There is a work around for now. Return the same component from uiComponent() instead of creating a new one every time.
eg. for your example.
JPanel jp = new JPanel();
jp.setLayout(new BoxLayout(jp, BoxLayout.PAGE_AXIS));
jp.add(new JLabel("Test Label"));
return api.userInterface().registerHttpRequestEditorProvider(editorCreationContext -> new ExtensionProvidedHttpRequestEditor() {
@Override
public HttpRequest getRequest() {
return null;
}
@Override
public void setRequestResponse(HttpRequestResponse httpRequestResponse) {
}
@Override
public boolean isEnabledFor(HttpRequestResponse httpRequestResponse) {
return false;
}
@Override
public String caption() {
return "xxxxxxxxxxxxxxxxx";
}
@Override
public Component uiComponent() {
return jp;
}
@Override
public Selection selectedData() {
return null;
}
@Override
public boolean isModified() {
return false;
}
});
}
Fixed, but the problem still persists
You need to return "true" for requests you are interested in (or just return true if you want it to always show)
@Override
public boolean isEnabledFor(HttpRequestResponse httpRequestResponse) {
return true;
}
This should be fixed in 2023.2, Closing.
Hello,I want to know how to get the origin MessageEditorHttpRequestResponse Object when i register a custom tab?Looking forward to your reply.
You can use getRequest()
on the ExtensionProvidedHttpRequestEditor
to get the contents of the current request.
Hope this helps!
Version 2023.1, the code is as follows:
public Registration xregisterSuiteTab() {
Also, can there be a complete sample reference file?