■ ■ ■ ■ ■ ■
src/main/java/com/nccgroup/loggerplusplus/LoggerPlusPlus.java
| skipped 20 lines |
21 | 21 | | import javax.swing.*; |
22 | 22 | | import java.awt.*; |
23 | 23 | | import java.net.URL; |
| 24 | + | import java.util.Arrays; |
24 | 25 | | import java.util.List; |
25 | 26 | | |
26 | 27 | | import static com.nccgroup.loggerplusplus.util.Globals.PREF_RESTRICT_TO_SCOPE; |
| skipped 158 lines |
185 | 186 | | return exportController; |
186 | 187 | | } |
187 | 188 | | |
188 | | - | public Frame getLoggerFrame(){ |
| 189 | + | public Frame getLoggerFrame() { |
| 190 | + | if (mainViewController == null) { |
| 191 | + | return Arrays.stream(JFrame.getFrames()).filter(frame -> { |
| 192 | + | return frame.getTitle().startsWith("Burp Suite") && frame.isVisible(); |
| 193 | + | }).findFirst().orElse(null); |
| 194 | + | } |
189 | 195 | | return JOptionPane.getFrameForComponent(mainViewController.getTabbedPanel()); |
190 | 196 | | } |
191 | 197 | | } |
| skipped 1 lines |