Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exim: Fix duplicate "Save URLs..." options #6012

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions addOns/exim/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Fixed
- Import HAR entry sent and elapsed time.
- Duplicate or missing "Save URLs..." entries in the Export menu.
- The "Save All URLs..." export option was saving only the selected URLs.

## [0.12.0] - 2024-10-07
### Changed
Expand Down
71 changes: 33 additions & 38 deletions addOns/exim/src/main/java/org/zaproxy/addon/exim/ExtensionExim.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ public class ExtensionExim extends ExtensionAdaptor {

private PopupMenuExportMessages popupMenuExportResponses;
private PopupMenuExportMessages popupMenuExportMessages;
private PopupMenuExportContextUrls popupMenuExportContextUrls;
private PopupMenuExportSelectedUrls popupMenuExportSelectedrls;
private PopupMenuExportUrls popupMenuExportUrls;
private PopupMenuCopyUrls popupMenuCopyUrls;

public ExtensionExim() {
Expand Down Expand Up @@ -98,14 +95,39 @@ public void hook(ExtensionHook extensionHook) {
getMenuExport().add(getPopupMenuExportResponses());
}

extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuExportContextUrls());
getMenuExport().add(getPopupMenuExportContextUrls());

extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuExportSelectedUrls());
getMenuExport().add(getPopupMenuExportSelectedUrls());

extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuExportUrls());
getMenuExport().add(getPopupMenuExportUrls());
extensionHook
.getHookMenu()
.addPopupMenuItem(
new PopupMenuExportContextUrls(
Constant.messages.getString("exim.menu.export.saveurls"),
this));
getMenuExport()
.add(
new PopupMenuExportContextUrls(
Constant.messages.getString("exim.menu.export.context.urls"),
this));

extensionHook
.getHookMenu()
.addPopupMenuItem(
new PopupMenuExportSelectedUrls(
Constant.messages.getString("exim.menu.export.saveurls"),
this));
getMenuExport()
.add(
new PopupMenuExportSelectedUrls(
Constant.messages.getString("exim.menu.export.popup.selected"),
this));

extensionHook
.getHookMenu()
.addPopupMenuItem(
new PopupMenuExportUrls(
Constant.messages.getString("exim.menu.export.popup"), this));
getMenuExport()
.add(
new PopupMenuExportUrls(
Constant.messages.getString("exim.menu.export.popup"), this));

extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuCopyUrls());

Expand Down Expand Up @@ -204,33 +226,6 @@ private PopupMenuExportMessages getPopupMenuExportResponses() {
return popupMenuExportResponses;
}

private PopupMenuExportContextUrls getPopupMenuExportContextUrls() {
if (popupMenuExportContextUrls == null) {
popupMenuExportContextUrls =
new PopupMenuExportContextUrls(
Constant.messages.getString("exim.menu.export.context.urls"), this);
}
return popupMenuExportContextUrls;
}

private PopupMenuExportSelectedUrls getPopupMenuExportSelectedUrls() {
if (popupMenuExportSelectedrls == null) {
popupMenuExportSelectedrls =
new PopupMenuExportSelectedUrls(
Constant.messages.getString("exim.menu.export.popup.selected"), this);
}
return popupMenuExportSelectedrls;
}

private PopupMenuExportUrls getPopupMenuExportUrls() {
if (popupMenuExportUrls == null) {
popupMenuExportUrls =
new PopupMenuExportSelectedUrls(
Constant.messages.getString("exim.menu.export.popup"), this);
}
return popupMenuExportUrls;
}

private PopupMenuCopyUrls getPopupMenuCopyUrls() {
if (popupMenuCopyUrls == null) {
popupMenuCopyUrls =
Expand Down
12 changes: 6 additions & 6 deletions addOns/exim/src/main/javahelp/help/contents/exim.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,16 @@ <H3>Save Responses...</H3>
<H3>Save Sites Tree...</H3>
This allows you to save the Sites Tree in the <a href="sitestreeformat.html">Sites Tree format</a>

<H3>Save URLs...</H3>
This allows you to save all of the URLs accessed to a text or HTML file. <br/>
<H3>Save All URLs...</H3>
This allows you to save all the accessed URLs to a text or HTML file. <br/>
This can be used, amongst other things, to compare the URLs available to users with
different roles or permissions on the same system.
(Also consider leveraging the Access Control Testing add-on.)
This functionality is also available via the right-click context menu.
This functionality is also available via the right-click context menu in the Sites tree panel.

<H3>Context: Save URLs...</H3>
All URLs in the Sites tree that fall within the selected context are exported. This functionality is
also available from the right-click menu when used on a Context node in the Sites tree panel.
<H3>Save URLs...</H3>
All URLs in the Sites tree that fall within the selected node are exported. This functionality is
also available from the right-click menu when used on a Site or Context node in the Sites tree panel.

<H2>ZAP API</H2>
This add-on also exposes various ZAP API endpoints to facilitate programmatic use of the functionality.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,16 @@ exim.importurls.warn.scheme = "{0}" does not have a scheme.

exim.menu.copyurls.popup = Copy URLs
exim.menu.export = Export
exim.menu.export.context.urls = Save URLs...
exim.menu.export.context.urls = Save Context URLs...
exim.menu.export.messages.popup = Save Messages...
exim.menu.export.messages.select.warning = Select HTTP messages in History panel before export to file.
exim.menu.export.mnemonic = E
exim.menu.export.popup = Save All URLs...
exim.menu.export.popup.context.error = Please select a Context.
exim.menu.export.popup.selected = Save URLs...
exim.menu.export.popup.selected = Save Selected URLs...
exim.menu.export.responses.popup = Save Response(s)...

exim.menu.export.savesite.popup = Save Sites Tree...
exim.menu.export.saveurls = Save URLs...
exim.menu.export.urls.save.error = Error saving file to {0}

exim.options.value.type.har = HAR (HTTP Archive File)
Expand Down
Loading