-
Notifications
You must be signed in to change notification settings - Fork 14
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
Spawn new Firefox for external page links utilizing MimeType=x-scheme-handler/extlink #428
base: main
Are you sure you want to change the base?
Conversation
How do you have configured the launcher? And how do you open the external link? Please try to run on terminal xdg-open your_link are there more firefox instances run? |
Please attach your config files for the x-scheme-handler/extlink here, thanks. |
d145f61
to
7768ff6
Compare
@stransky After some debugging I figured out the the reason for the 'double windows' was a 'target="_blank"' attribute in the link definition. |
Awesome! |
4542f9f
to
b419010
Compare
b419010
to
3d538a7
Compare
@stransky is almost works nice, just one last detail that I was not able to figure out yet. Maybe you have it easier. However, we have for the 'Report a bug' dialog another way to open the link to bugzilla, with the filled report. This uses window.open("https://bugzilla.redhat.com.. following the details of the bug filled it. I replaced the https with extlink like in the hrefs, and this indeed opens a new browser window, but additionaly it opens a blank tab in the current anaconda-webui browser. I can easily reproduce if I write Any suggestions what is the difference between href link handling and window.open. Thanks in advance. ~~ |
c709c45
to
8ea67b6
Compare
@stransky can you take a look at #428 (comment) please for some hint? |
Yes will look at it. |
@stransky friendly reminder that I still need some help hear when you dont have your hands full (Just in case it fell through :)) |
Sorry for the delay, will look at it. |
Can you post me an example of the broken link which creates extra tab? I tested it and I can't reproduce. I tested random concur link like: |
Please share full href link which is broken for you. |
@stransky links with href work as expected. (See comment #428 (comment)) The problem is that we have one Link in the UI - where we need cant specify href (<a href=...) but instead we asynchronously run This causes the problem. You can easily reproduce if you write window.open("extlink://github.com") in the anaconda-webui browser console. |
Can you attach the webpage you use which contains the window.open() code? |
The window.open is ran from the browser console where Web UI runs. How do you want me to attach that web page? |
If you ask users to submit the bug report, which HTML/JS construction is used by Web UI HTML code to perform it? Does the Web UI HTML page contains something like:
Or do you ask users to open browser console and type window.open() there? |
@stransky oh sure - it's a |
|
Okay, I expect you use something like |
You may use window.location.replace() instead of open(): |
The HTML content as copied as from browser is: <a aria-disabled="false" class="pf-v5-c-button pf-m-primary pf-m-progress" data-ouia-component-type="PF5/Button" data-ouia-safe="true" data-ouia-component-id="OUIA-Generated-Button-primary-2"><span class="pf-v5-c-button__icon pf-m-start"><svg class="pf-v5-svg" viewBox="0 0 512 512" fill="currentColor" aria-hidden="true" role="img" width="1em" height="1em"><path d="M432,320H400a16,16,0,0,0-16,16V448H64V128H208a16,16,0,0,0,16-16V80a16,16,0,0,0-16-16H48A48,48,0,0,0,0,112V464a48,48,0,0,0,48,48H400a48,48,0,0,0,48-48V336A16,16,0,0,0,432,320ZM488,0h-128c-21.37,0-32.05,25.91-17,41l35.73,35.73L135,320.37a24,24,0,0,0,0,34L157.67,377a24,24,0,0,0,34,0L435.28,133.32,471,169c15,15,41,4.5,41-17V24A24,24,0,0,0,488,0Z"></path></svg></span>Report issue</a> Trying your suggestion thanks :) |
btw. It took me 2 mins with google, the answer is right here: |
8ea67b6
to
f248bd1
Compare
88835db
to
bfde599
Compare
* Extended firefox-theme to include an extlink profile for opening external links. * Disabled the popup asking for verification by using dom.disable_beforeunload, preventing the confirmation dialog when closing the window. * Removed the custom window.onbeforeunload = () => "";, as it interfered with the external window opening behavior. Note: A new approach will be needed to prevent the window from closing, as the previous method is no longer in use.
bfde599
to
1bd450b
Compare
This is ready for review. |
Err uh... that's completely invalid HTML...
An anchor tag needs either a name if it's being linked to (but this is a deprecated usage) or an href. No exceptions. This can only be written as If it's supposed to be a button, then it should be a button. But it cannot be an |
This is just an example how replace window.open() with window.location.replace() to open a link in the same window. I guess you can incorporate it to WebUI accordingly. |
Right, it's an example, but it's definite not an example of valid HTML, and not really the right way to do things. |
AwesomeScreenshot-10_9_2024.6_00_35PM.webm