Skip to content

Commit

Permalink
fix(office): Allow download of files via embedded links in Chrome (#1277
Browse files Browse the repository at this point in the history
)
  • Loading branch information
jstoffan committed Nov 2, 2020
1 parent 480a90d commit 281b9ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/viewers/office/OfficeViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ class OfficeViewer extends BaseViewer {
iframeEl.setAttribute('width', '100%');
iframeEl.setAttribute('height', '100%');
iframeEl.setAttribute('frameborder', 0);
iframeEl.setAttribute('sandbox', 'allow-scripts allow-same-origin allow-forms allow-popups');
iframeEl.setAttribute('sandbox', 'allow-scripts allow-same-origin allow-forms allow-popups allow-downloads');

if (this.platformSetup) {
iframeEl.setAttribute('allowfullscreen', 'true');
Expand Down
4 changes: 3 additions & 1 deletion src/lib/viewers/office/__tests__/OfficeViewer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,9 @@ describe('lib/viewers/office/OfficeViewer', () => {
expect(iframeEl.width).toBe('100%');
expect(iframeEl.height).toBe('100%');
expect(iframeEl.frameBorder).toBe('0');
expect(iframeEl.getAttribute('sandbox')).toBe('allow-scripts allow-same-origin allow-forms allow-popups');
expect(iframeEl.getAttribute('sandbox')).toBe(
'allow-scripts allow-same-origin allow-forms allow-popups allow-downloads',
);
});

test('should allow fullscreen if using the platform setup', () => {
Expand Down

0 comments on commit 281b9ab

Please sign in to comment.