Skip to content

Download button do not allow popup new download in separate tab #583

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

Closed
luipir opened this issue Mar 12, 2025 · 5 comments
Closed

Download button do not allow popup new download in separate tab #583

luipir opened this issue Mar 12, 2025 · 5 comments
Labels
question Further information is requested

Comments

@luipir
Copy link

luipir commented Mar 12, 2025

We had an issue integrating stac-browser in the PCKE infrastructure that we have to use. Due to issue/limitation, we want to override it opening download in a separate popup but the stac-broser do not do this in a https context.
The reason of this is that stac-browser is using StreamSaver.js here to allow stream download.

IMHO this behaviour should be configurable and do not force to remain in the same page opening an hidden iframe.

The issue is reproducible in HTTPS download where the StreamSaver.js create an hidden iframe to manage the stream. if context is not secure (e.g. http download), then a new tab is open to create secure connection.

I already open a feature request to StreamStream.js to add a configuration parameter to force or not iframe/popup use:
jimmywarting/StreamSaver.js#359

@luipir
Copy link
Author

luipir commented Mar 13, 2025

I was copletly wrong and no altDownload was used. instead the new popup was prevented by download property set to download="download" in:
https://github.com/radiantearth/stac-browser/blob/main/src/components/HrefActions.vue#L162

I'll prepare a PR to allow this disable by conf if I understand how configuration is propagated and accessed in each component.

@m-mohr
Copy link
Collaborator

m-mohr commented Mar 18, 2025

I don't understand what the actual issue is here. Why would you want a popup?

@luipir
Copy link
Author

luipir commented Mar 19, 2025

I don't understand what the actual issue is here. Why would you want a popup?

yes, sorry, my request was a bit confusionary. I wrongly wrote PopUp instead of Tab.
In resume, how the code is done, the templase of HrefAction prevent to open the download action in a new tab.
For reason that I'm not clear to me, a new tab is opened just modifying props for this template: https://github.com/radiantearth/stac-browser/blob/main/src/components/HrefActions.vue#L7 and coding props in this way

   downloadProps() {
      if (this.hasDownloadButton && !this.useAltDownloadMethod) {
        const props = {
          href: this.href,
          target: '_blank',
          rel: 'noopener noreferrer',
        };
        return props;
      }
      return {};
    },

e.g. in resume a new Tab is open ONLY if download property is not available or set to empty string. if download pros has a value then the new tab is not opened.

hopefully is more clear now.

@m-mohr
Copy link
Collaborator

m-mohr commented Apr 3, 2025

I'm still sure whether I can follow. Do you want to open a new tab or not and why?

A new tab should always be opened due to target=_blank.
If you don't want to open a new tab, remove the target=_blank. In this case user could enforce a new tab using middle mouse button click or the context menu.
I don't think the download property has an influence on this behaviour.

Whether to set target=_blank is probably debatable.

@m-mohr m-mohr added question Further information is requested and removed upstream labels Apr 3, 2025
@m-mohr
Copy link
Collaborator

m-mohr commented May 8, 2025

Closing for now as the potential work item is not clear enough.

@m-mohr m-mohr closed this as not planned Won't fix, can't repro, duplicate, stale May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants