Skip to content

Commit 11b7720

Browse files
authored
Merge pull request #55 from gdgd009xcd/JOHANESS250122
## [v0.8.18] - 2025-01-22
2 parents dd1383f + cda5845 commit 11b7720

File tree

4 files changed

+16
-34
lines changed

4 files changed

+16
-34
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ This addon is 3rd party addon, so you must add this addon file to ZAPROXY manual
9696
## how to use
9797

9898
1. Active Scan Input Vectors option panel<br>
99-
This addon is automatically called when you start active scannig after already installed default scanners.
99+
When you start active scannig, This addon is automatically called next to the already installed default scanners.
100100
If this addon look like doing nothing, you should check:<br> [Tools->Options->Active Scan Input Vectors] option panel.<br>
101101
If nothing is enabled in this options panel, you may push<br>[Reset to factory defaults] button or check on individually.
102102
![InputVectors](assets/images/activescaninputvectors.png)

addOns/customactivescan/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ All notable changes to this add-on will be documented in this file.
33

44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
55

6+
## [v0.8.18] - 2025-01-22
7+
### Changed
8+
- bugfix: Fixed a weird popup menu that enlarge each time when it is shown in the ScanLog panel.
9+
610
## [v0.8.17] - 2025-01-20
711
### Changed
812
- bugfix: fixed null exception errors with using CustomScan Main Panel GUI. I apologize for the inconvenience.

addOns/customactivescan/customactivescan.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import org.zaproxy.gradle.addon.AddOnStatus
22

33

4-
version = "0.8.17"
4+
version = "0.8.18"
55
description = "a Active Scanner with custmizable rules"
66

77
val jar by tasks.getting(Jar::class) {
Lines changed: 10 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,28 @@
11
package org.zaproxy.zap.extension.customactivescan.view;
22

3-
import org.parosproxy.paros.view.MainPopupMenu;
43
import org.parosproxy.paros.view.View;
54
import org.zaproxy.zap.view.messagecontainer.http.DefaultSingleHttpMessageContainer;
65

76
import javax.swing.*;
8-
import javax.swing.text.Position;
97
import java.awt.*;
108

119
public class ScanLogPanelPopUp extends JPopupMenu {
1210

11+
private static final long serialVersionUID = 1L;
1312
private final static org.apache.logging.log4j.Logger LOGGER4J =
1413
org.apache.logging.log4j.LogManager.getLogger();
1514

16-
private MainPopupMenu mainPopupMenu;
17-
private ScanLogPanel scanLogPanel;
18-
private JViewport scanLogViewPort = null;
15+
final private ScanLogPanel scanLogPanel;
16+
final private JViewport scanLogViewPort;
17+
1918
ScanLogPanelPopUp(JScrollPane scanLogScroller, ScanLogPanel scanLogPanel) {
2019
this.scanLogPanel = scanLogPanel;
21-
this.mainPopupMenu = View.getSingleton().getPopupMenu();
2220
this.scanLogViewPort = scanLogScroller.getViewport();
2321
}
24-
private static final long serialVersionUID = 1L;
25-
2622

27-
@Override
28-
public JMenuItem add(JMenuItem item) {
29-
return this.mainPopupMenu.add(item);
30-
}
3123
@Override
3224
public void show(Component invoker, int x, int y) {
33-
/**
34-
if (!httpPanelTextArea.isFocusOwner()) {
35-
httpPanelTextArea.requestFocusInWindow();
36-
}
3725

38-
if (httpPanelTextArea.getMessage() instanceof HttpMessage) {
39-
SingleHttpMessageContainer messageContainer =
40-
new DefaultSingleHttpMessageContainer(
41-
messageContainerName,
42-
httpPanelTextArea,
43-
(HttpMessage) httpPanelTextArea.getMessage());
44-
View.getSingleton().getPopupMenu().show(messageContainer, x, y);
45-
} else {
46-
View.getSingleton().getPopupMenu().show(httpPanelTextArea, x, y);
47-
}
48-
**/
4926
LOGGER4J.debug("scanLogPane is " + (scanLogPanel==null ? "null" : "valid"));
5027
if (scanLogPanel.getSelectedMessage() != null) {
5128

@@ -59,13 +36,14 @@ public void show(Component invoker, int x, int y) {
5936
scanLogPanel,
6037
scanLogPanel.getSelectedMessage());
6138
Point viewPoint = this.scanLogViewPort.getViewPosition();
62-
// fix popup is showed in outer area of scanLogViewPort
63-
this.mainPopupMenu.show(messageContainer, x, y - viewPoint.y);
64-
65-
LOGGER4J.debug("x=" + x + " y=" + y);
39+
// fix popup is showed in outer area of scanLogViewPort y -> y -viewPoint.y
40+
// Don't get the instance of org.parosproxy.paros.view.MainPopupMenu from View.getSingleton().getPopupMenu() directly.
41+
// Because it is not a pure singleton instance. if you get the instance from View.getSingleton().getPopupMenu() and reuse it,
42+
// you may encouter strange behavior that the popup menu enlarge its size each time when it is shown.
43+
View.getSingleton().getPopupMenu().show(messageContainer, x, y - viewPoint.y);
44+
LOGGER4J.debug("x=" + x + " y=" + (y - viewPoint.y));
6645
} else {
6746
LOGGER4J.debug("getSelectedMessage is NULL");
6847
}
69-
7048
}
7149
}

0 commit comments

Comments
 (0)