Merge pull request #4162 from matrix-org/t3chguy/double_download

Fix having to decrypt & download in two steps
pull/21833/head
Michael Telatynski 2020-03-03 11:45:57 +00:00 committed by GitHub
commit ca274dde4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -247,6 +247,8 @@ export default createReactClass({
}); });
}; };
// This button should actually Download because usercontent/ will try to click itself
// but it is not guaranteed between various browsers' settings.
return ( return (
<span className="mx_MFileBody"> <span className="mx_MFileBody">
<div className="mx_MFileBody_download"> <div className="mx_MFileBody_download">
@ -290,7 +292,7 @@ export default createReactClass({
src={`${url}?origin=${encodeURIComponent(window.location.origin)}`} src={`${url}?origin=${encodeURIComponent(window.location.origin)}`}
onLoad={onIframeLoad} onLoad={onIframeLoad}
ref={this._iframe} ref={this._iframe}
sandbox="allow-scripts allow-downloads" /> sandbox="allow-scripts allow-downloads allow-downloads-without-user-activation" />
</div> </div>
</span> </span>
); );

View File

@ -27,6 +27,7 @@ function remoteRender(event) {
// Don't display scrollbars if the link takes more than one line to display. // Don't display scrollbars if the link takes more than one line to display.
body.style = "margin: 0px; overflow: hidden"; body.style = "margin: 0px; overflow: hidden";
body.appendChild(a); body.appendChild(a);
a.click(); // try to trigger download automatically
} }
function remoteSetTint(event) { function remoteSetTint(event) {