Skip to content

fixes #1881: Open generatorUrl in a new browser tab. - #2470

Open
dpryden wants to merge 1 commit into
prometheus:mainfrom
dpryden:master
Open

dpryden wants to merge 1 commit into
prometheus:mainfrom
dpryden:master

Conversation

@dpryden

@dpryden dpryden commented Jan 29, 2021

Copy link
Copy Markdown

There does not appear to be a good way to reliably determine in
onUrlRequest whether the URL being navigated to is an Internal or
External URL, especially if Alertmanager is hosted on the same domain as
other services (for example, Prometheus). To workaround this problem for
the specific case of the generatorUrlButton (labeled "Source"), we force
it to have target="_blank", which prevents Elm from intercepting the URL
and trying to do client-side navigation.

Signed-off-by: Daniel Pryden daniel@pryden.net

@dpryden

dpryden commented Jan 29, 2021

Copy link
Copy Markdown
Author

This PR is supposed to be associated with #1881 but it doesn't seem to be linked, I'm not sure if I did something wrong when creating the PR.

@hooten

hooten commented Feb 6, 2021

Copy link
Copy Markdown
Contributor

The easiest way to link a PR to an issue is using a keyword in the PR description.

@dpryden

dpryden commented Feb 6, 2021

Copy link
Copy Markdown
Author

The easiest way to link a PR to an issue is using a keyword in the PR description.

Thank you for your response, @hooten. Doesn't the commit message title contain a properly formatted keyword? That was my intention by writing fix #1881 at the start of the message.

@dpryden dpryden changed the title fix #1881: Open generatorUrl in a new browser tab. fix prometheus/alertmanager#1881: Open generatorUrl in a new browser tab. Feb 6, 2021
@dpryden dpryden changed the title fix prometheus/alertmanager#1881: Open generatorUrl in a new browser tab. fixes #1881: Open generatorUrl in a new browser tab. Feb 6, 2021
@hooten

hooten commented Feb 7, 2021

Copy link
Copy Markdown
Contributor

@dpryden my bad! You're right. It looks like the commit message did in fact link the issue. Sorry for the confusion

@stale stale Bot added the stale label Apr 10, 2021
@JohanElmis

JohanElmis commented Apr 14, 2021 •

Copy link
Copy Markdown

I'm having the same issue where I have a nginx frontend and proxies to alertmanager or different prometheus-hosts based on path.
The Alertmanager Source-link for an Alert just reloads the page as it is now, despite that the link is correct (works if copied and opened in new tab). This new-tab solution will work well for me.

@stale stale Bot removed the stale label Apr 14, 2021
@stale stale Bot added the stale label Jun 13, 2021
@stale stale Bot removed the stale label Jul 17, 2021
@stale stale Bot added the stale label Sep 19, 2021
@tommyk

tommyk commented Oct 17, 2022

Copy link
Copy Markdown

would love to see this issue get fixed. can we fix conflicts and merge? i can create another PR if this has been abandoned.

@dpryden

dpryden commented Oct 17, 2022

Copy link
Copy Markdown
Author

Sorry, I haven't looked at this PR in ages, I actually forgot it was still open. I just rebased it and regenerated the asset/assets_vfsdata.go, I think it should be up to date now.

@dpryden

dpryden commented Oct 17, 2022

Copy link
Copy Markdown
Author

@simonpasquier, you were the one who added the help wanted label on #1881 -- are you able to help review this?

There does not appear to be a good way to reliably determine in
onUrlRequest whether the URL being navigated to is an Internal or
External URL, especially if Alertmanager is hosted on the same domain as
other services (for example, Prometheus). To workaround this problem for
the specific case of the generatorUrlButton (labeled "Source"), we force
it to have target="_blank", which prevents Elm from intercepting the URL
and trying to do client-side navigation.

Signed-off-by: Daniel Pryden <daniel@pryden.net>
@kerma

kerma commented Feb 14, 2023

Copy link
Copy Markdown

Thanks for the fix @dpryden! @simonpasquier any way to get this reviewed/merged?

@SoloJacobs
SoloJacobs self-requested a review February 20, 2026 15:45
@SoloJacobs SoloJacobs self-assigned this Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants