diff --git a/web/src/js/components/Header/FlowMenu.tsx b/web/src/js/components/Header/FlowMenu.tsx index 713345c7e..da9d86c67 100644 --- a/web/src/js/components/Header/FlowMenu.tsx +++ b/web/src/js/components/Header/FlowMenu.tsx @@ -80,6 +80,11 @@ export default function FlowMenu(): JSX.Element { ) } +// Reference: https://stackoverflow.com/a/63627688/9921431 +const openInNewTab = (url) => { + const newWindow = window.open(url, '_blank', 'noopener,noreferrer') + if (newWindow) newWindow.opener = null +} function DownloadButton({flow}: { flow: Flow }) { if (flow.type !== "http") @@ -87,23 +92,23 @@ function DownloadButton({flow}: { flow: Flow }) { if (flow.request.contentLength && !flow.response?.contentLength) { return } if (flow.response) { const response = flow.response; if (!flow.request.contentLength && flow.response.contentLength) { return } if (flow.request.contentLength && flow.response.contentLength) { return 1}>Downloadâ–ľ } options={{"placement": "bottom-start"}}> - window.location.href = MessageUtils.getContentURL(flow, flow.request)}>Download + openInNewTab(MessageUtils.getContentURL(flow, flow.request))}>Download request - window.location.href = MessageUtils.getContentURL(flow, response)}>Download + openInNewTab(MessageUtils.getContentURL(flow, response))}>Download response }