Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Fix having to decrypt & download in two steps #4162

Merged
merged 1 commit into from
Mar 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/components/views/messages/MFileBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<span className="mx_MFileBody">
<div className="mx_MFileBody_download">
Expand Down Expand Up @@ -290,7 +292,7 @@ export default createReactClass({
src={`${url}?origin=${encodeURIComponent(window.location.origin)}`}
onLoad={onIframeLoad}
ref={this._iframe}
sandbox="allow-scripts allow-downloads" />
sandbox="allow-scripts allow-downloads allow-downloads-without-user-activation" />
</div>
</span>
);
Expand Down
1 change: 1 addition & 0 deletions src/usercontent/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function remoteRender(event) {
// Don't display scrollbars if the link takes more than one line to display.
body.style = "margin: 0px; overflow: hidden";
body.appendChild(a);
a.click(); // try to trigger download automatically
}

function remoteSetTint(event) {
Expand Down