I am developing an Outlook Addin to share content from within the task pane. I tested the code within outlook.office.com using Chrome browser and got the below error,
Error: Failed to execute 'getDisplayMedia' on 'MediaDevices': Access to the feature "display-capture" is disallowed by permission policy.
at Object.getDisplayMedia (index.js:419:33)
at i.value (index.js:5356:18)
at startShare (ving-taskpane1.html?et=:151:22)
at HTMLButtonElement.<anonymous> (ving-taskpane1.html?et=:70:17
On further checking the addin was loaded using iframe in the outlook webapp and the allow attribute doesn't have display-capture attribute required to trigger share screen request. Below is the iframe generated by outlook webapp.
<iframe
id="af8880bb-fe36-00b1-fcab-a9bc7e2834dc"
width="100%"
height="100%"
frameborder="0"
allowfullscreen="true"
title="Office Add-in Ving POC"
sandbox="allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-modals allow-downloads"
allow="geolocation;camera;microphone"
src="https://localhost:3000/1/ving-taskpane1.html?et="
name='{"baseFrameName":"_xdm_11__af8880bb-fe36-00b1-fcab-a9bc7e2834dc70614a4e_2c71cb85_1677045108327","hostInfo":"Outlook|Web|16.01|en-US|56e8da77-681c-d1af-4678-a6532aebc2e8|||16","xdmInfo":"2c232fb7_547ce556_1677045108327|af8880bb-fe36-00b1-fcab-a9bc7e2834dc|https://outlook.office.com","serializerVersion":1,"flights":"[]"}'
class="AddinIframe"
></iframe>
Is there is a way to customize the allow list options of iframe ?