PortSwigger / burp-extensions-montoya-api

Burp Extensions Api
Other
125 stars 3 forks source link

疑问 #47

Closed cloud-jie closed 1 year ago

cloud-jie commented 1 year ago

Reproduction steps:

  1. Click on any Repeater tab to switch to the custom HTTP request editor
  2. Click on another Repeater tab to switch to the custom HTTP request editor
  3. Click on the tab in the first step again This will cause the tab request in step 1 to be overwritten by the tab request in step 2, possibly due to: image And, during this process, the setRequestResponse method of the custom HTTP request editor was not requested, was it intentionally designed? May I ask for the reason?

Is it because I wrote the wrong code?

Hannah-PortSwigger commented 1 year ago

Hi

Can you provide some more information on what you are trying to do, and the code that you have written?

Have you checked out our example extension that adds an additional tab to the request editor? You can find it here: https://github.com/PortSwigger/burp-extensions-montoya-api-examples/tree/main/customrequesteditortab

cloud-jie commented 1 year ago

I found the key to the problem, which is my problem. In order to save trouble, I wrote the code like this.

api.userInterface().registerHttpRequestEditorProvider(editorCreationContext -> new ExtensionProvidedHttpRequestEditor() {
    ...
   @Override
    public Component uiComponent(){
            return MainPanel;
    }
}
private void UI() {
    MainPanel = new JPanel();
    ...
}

Thus causing the above-mentioned problems. problem solved

cloud-jie commented 1 year ago

Sorry to reopen this issue, but the problem has reappeared. Burp Suite version 2023.4.2 Montoya api version 2023.4 I also use an open source project, https://github.com/bobbylight/RSyntaxTextArea Here is the sample code CustomRequestEditorTab.zip

Hannah-PortSwigger commented 1 year ago

Hi

Could you please drop us an email at support@portswigger.net so we can look into this in more detail?

Hannah-PortSwigger commented 1 year ago

For further context, initialization of the text area needed to be moved into a constructor for the ExtensionProvidedHttpRequestEditor, to avoid a shared text area across multiple places.