Closed Bug 1568641 Opened 7 years ago Closed 7 years ago

Need ability to specify allow attribute on embedded live sample iframes

Categories

(developer.mozilla.org Graveyard :: Wiki pages, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: sheppy, Unassigned)

Details

We need the ability to specify requested permissions for samples in our iframes going forward, due to the dawn of the Feature Policy era. Without adding this capability, many of our integrated examples and the like will stop working. This will be particularly problematic in the documentation for WebRTC and other media APIs such as Media Capture, getDisplayMedia(), and MediaRecorder.

If we don't come up with a solution soon many of our pages will be presenting error messages to users on an increasingly frequent basis as users upgrade into browsers that emable Feature Policy by default, or for users who enable it themselves.

(I put this under "Wiki Pages" because it's the closest we have that I could think of. It's going to be an issue even post-wiki)

Note that camera and microphone already don't work in Chrome. E.g. in https://developer.mozilla.org/en-US/docs/Web/API/MediaStream_recording_API/Recording_a_media_element#Result

I get NotAllowedError: Permission denied because Chrome implements feature policy already.

Looks like we may already have the ability to do this. Will check to be sure it does the trick soon.

Based on this info, I was able to fix https://developer.mozilla.org/en-US/docs/Web/API/MediaStream_recording_API/Recording_a_media_element#Result as follows, by changing the call from:

<p>{{ EmbedLiveSample('Example', 600, 440) }}</p>

tp:

<p>{{ EmbedLiveSample('Example', 600, 440, "", "", "", "camera;microphone") }}</p>

We might want to scan for more places that need this.

Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WORKSFORME

Also, if there are new attributes needed that are currently not allowed, this is managed via constants here:
https://github.com/mozilla/kuma/blob/master/kuma/wiki/constants.py#L39

Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.