Skip to content

Commit

Permalink
Refactor custom Editor Tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
felixb1515 committed Jul 16, 2024
1 parent 532d68d commit 9e2a885
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 100 deletions.
1 change: 0 additions & 1 deletion src/main/java/burp/BurpExtender.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public void initialize(MontoyaApi api) {
api.http().registerHttpHandler(new CstcHttpHandler(view));
api.userInterface().registerSuiteTab(extensionName, view);
api.userInterface().registerHttpRequestEditorProvider(new MyHttpRequestEditorProvider(view));
api.userInterface().registerHttpResponseEditorProvider(new MyHttpResponseEditorProvider(view));

if (!api.burpSuite().version().edition().equals(BurpSuiteEdition.COMMUNITY_EDITION)) {
PersistedObject persistence = api.persistence().extensionData();
Expand Down
15 changes: 12 additions & 3 deletions src/main/java/burp/MyExtensionProvidedHttpRequestEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import burp.api.montoya.MontoyaApi;
import burp.api.montoya.core.ByteArray;
import burp.api.montoya.core.ToolType;
import burp.api.montoya.http.message.HttpRequestResponse;
import burp.api.montoya.http.message.requests.HttpRequest;
import burp.api.montoya.repeater.Repeater;
import burp.api.montoya.ui.Selection;
import burp.api.montoya.ui.editor.EditorOptions;
import burp.api.montoya.ui.editor.RawEditor;
Expand All @@ -23,9 +25,16 @@ public class MyExtensionProvidedHttpRequestEditor implements ExtensionProvidedHt

MyExtensionProvidedHttpRequestEditor(EditorCreationContext creationContext, View view)
{
this.api = BurpUtils.getInstance().getApi();
this.view = view;
requestEditor = api.userInterface().createRawEditor(EditorOptions.READ_ONLY);
if(creationContext.toolSource().isFromTool(ToolType.REPEATER)) {
this.api = BurpUtils.getInstance().getApi();
this.view = view;
requestEditor = api.userInterface().createRawEditor(EditorOptions.READ_ONLY);
}
else {
this.api = null;
this.view = null;
this.requestEditor = null;
}
}

@Override
Expand Down
73 changes: 0 additions & 73 deletions src/main/java/burp/MyExtensionProvidedHttpResponseEditor.java

This file was deleted.

23 changes: 0 additions & 23 deletions src/main/java/burp/MyHttpResponseEditorProvider.java

This file was deleted.

0 comments on commit 9e2a885

Please sign in to comment.