Office AddIn - Update iframe allow list

Saravana 161 Reputation points
2023-02-22T06:16:15.1033333+00:00

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 ?

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
4,057 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. yuanzu shi 0 Reputation points
    2023-06-14T10:07:00.0566667+00:00

    allow add: "display-capture"

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.