Skip to content

Commit

Permalink
Merge pull request #3485 from nextcloud/backport/3480/stable26
Browse files Browse the repository at this point in the history
[stable26] fix: emit allow attribute on all iframes for the clipboard (related t…
  • Loading branch information
max-nextcloud committed Feb 21, 2024
2 parents 437d4a1 + 9201973 commit bb022af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/document.js
Expand Up @@ -206,7 +206,7 @@ const documentsMain = {
+ '</form>'

// iframe that contains the Collabora Online Viewer
const frame = '<iframe data-cy="coolframe" id="loleafletframe" name="loleafletframe_viewer" allowfullscreen nonce="' + btoa(getRequestToken()) + '" style="width:100%;height:100%;position:absolute;"/>'
const frame = '<iframe data-cy="coolframe" id="loleafletframe" name="loleafletframe_viewer" allowfullscreen allow="clipboard-read *; clipboard-write *" nonce="' + btoa(getRequestToken()) + '" style="width:100%;height:100%;position:absolute;"/>'

$('#revViewer').append(form)
$('#revViewer').append(frame)
Expand Down Expand Up @@ -266,7 +266,7 @@ const documentsMain = {
+ '</form>'

// iframe that contains the Collabora Online
const frame = '<iframe data-cy="coolframe" id="loleafletframe" name="loleafletframe" nonce="' + btoa(getRequestToken()) + '" scrolling="no" allowfullscreen style="width:100%;height:100%;position:absolute;" />'
const frame = '<iframe data-cy="coolframe" id="loleafletframe" name="loleafletframe" nonce="' + btoa(getRequestToken()) + '" scrolling="no" allowfullscreen allow="clipboard-read *; clipboard-write *" style="width:100%;height:100%;position:absolute;" />'

$('#mainContainer').append(form)
$('#mainContainer').append(frame)
Expand Down
2 changes: 1 addition & 1 deletion src/files.js
Expand Up @@ -93,7 +93,7 @@ const odfViewer = {

$('head').append($('<link rel="stylesheet" type="text/css" href="' + generateFilePath('richdocuments', 'css', 'mobile.css') + '"/>'))

const $iframe = $('<iframe data-cy="documentframe" id="richdocumentsframe" nonce="' + btoa(OC.requestToken) + '" scrolling="no" allowfullscreen src="' + documentUrl + '" />')
const $iframe = $('<iframe data-cy="documentframe" id="richdocumentsframe" nonce="' + btoa(OC.requestToken) + '" scrolling="no" allowfullscreen allow="clipboard-read *; clipboard-write *" src="' + documentUrl + '" />')
odfViewer.loadingTimeout = setTimeout(odfViewer.onTimeout,
(OC.getCapabilities().richdocuments.config.timeout * 1000 || 15000))
$iframe.src = documentUrl
Expand Down

0 comments on commit bb022af

Please sign in to comment.