Skip to content

Disable download button in response body #4476

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
orbex opened this issue Apr 25, 2018 · 5 comments
Closed

Disable download button in response body #4476

orbex opened this issue Apr 25, 2018 · 5 comments

Comments

@orbex
Copy link

orbex commented Apr 25, 2018

Q A
Bug or feature request? feature request
Which Swagger/OpenAPI version? 2.0
Which Swagger-UI version? 3.13.6
How did you install Swagger-UI? copied src
Which browser & version? na
Which operating system? na

Is there any way to disable the grey download-button in the response body (besides setting display: none; in custom CSS) ?
At this moment it does not work anyway (just calls an empty js-function).

@heldersepu
Copy link
Contributor

...it works fine for me, try it out here:
http://swagger-net-test.azurewebsites.net/swagger/ui/index#/ApiExplorer/ApiExplorer_Get
the download gives me a file named response.txt

@shockey
Copy link
Contributor

shockey commented Apr 26, 2018

Hi @orbex!

Is there any way to disable the grey download-button in the response body

Sure, here's a plugin that disables the Download button everywhere that HighlightCode is used:

const HideResponseDownloadButtonPlugin = function(system) {
  return {
    wrapComponents: {
      highlightCode: (Ori) => (props) => {
        return system.React.createElement(Ori, Object.assign({}, props, { downloadable: false }))
      }
    }
  }
}

At this moment it does not work anyway

It's meant to be working 😄 I'd hazard a guess that this is a browser bug, what OS/browser are you seeing this with?

@orbex
Copy link
Author

orbex commented Apr 26, 2018

Thanks guys, will implement the plugin.
The fact that it is not working seems a browser bug indeed...
Buggy browser: Pale Moon 27.9.0 on Win 7 Pro
Working in FireFox 58.0.2 on Win 7 Pro

@shockey
Copy link
Contributor

shockey commented May 10, 2018

Closing due to inactivity.

This is simply to keep our issue tracker clean - feel free to comment if there are any further thoughts or concerns, and we'll be happy to reopen this issue.

@shockey shockey closed this as completed May 10, 2018
@shockey
Copy link
Contributor

shockey commented Sep 17, 2018

@orbex, looking through this again, my apologies for closing without wrapping this one up.

We don't support Pale Moon, but if you ever figure out what's going wrong, we'd be happy to take a PR that fixes it there without breaking it anywhere else 😄

@lock lock bot locked and limited conversation to collaborators Sep 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants