mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2026-09-03 05:10:16 +03:00
Open processor "Open in browser" CTAs in a new tab (#7045)
## Description The processor home-hero and download-editor modal "Open in browser" buttons were meant to open the editor in a new tab, but they used `window.location.href = EDITOR_URL`, which replaces the current tab. This switches both to `window.open(EDITOR_URL, "_blank", "noopener,noreferrer")`, matching the existing behaviour of the "Open" button in `EditorStatusCard.tsx`. The `noopener,noreferrer` flags mirror that same call and prevent the new tab from getting a `window.opener` reference. ## Changes - `WelcomeBanner.tsx` — home-hero "Open in browser" CTA - `DownloadEditorModal.tsx` — download modal "Open in browser" CTA ## Notes `EDITOR_URL` can resolve to a same-origin path when the editor is the same SPA, so opening in a new tab triggers a full page load of the editor app. This is the expected behaviour for "Open in browser".
This commit is contained in:
@@ -255,7 +255,7 @@ export function DownloadEditorModal({ open, onClose }: Props) {
|
||||
variant="secondary"
|
||||
leftSection={<OpenInNewRounded sx={{ fontSize: 15 }} />}
|
||||
onClick={() => {
|
||||
window.location.href = EDITOR_URL;
|
||||
window.open(EDITOR_URL, "_blank", "noopener,noreferrer");
|
||||
}}
|
||||
>
|
||||
{t("portal.home.download.openInBrowser")}
|
||||
|
||||
@@ -78,7 +78,7 @@ export function WelcomeBanner({ footer }: WelcomeBannerProps) {
|
||||
className="portal-welcome__cta"
|
||||
leftSection={<ExternalLinkIcon size={15} />}
|
||||
onClick={() => {
|
||||
window.location.href = EDITOR_URL;
|
||||
window.open(EDITOR_URL, "_blank", "noopener,noreferrer");
|
||||
}}
|
||||
>
|
||||
{t("portal.welcome.openInBrowser")}
|
||||
|
||||
Reference in New Issue
Block a user