Adding attribute to HTML tag

Hi,
In a browserFrame, I have embedded a site that uses microphone. In order for it to work I need to add an attribute to the iframe HTML tag (allow=“microphone”) see Deprecating Permissions in Cross-Origin Iframes
I could not find a way to specify the “allow” attribute (nop ermission are asked, but if I add the attribute using the developer module of Chrome, it is working).

What is the cleanest way to add the allow attribute to an ifram HTML element?

PS: I know I can inject Javascript in the page to dynamically add the missing attribute, however this is looks like a hack to me.

Thanks!

Thierry

Hi,

There is a special HtmlAttributes API in the framework, but it is not useful in case of BrowserFrame, since <iframe> is not the root element of the component.

Unfortunately, the simplest way for now is to add allow attribute using JavaScript extension.

We will try to support it in the future: Support setting DOM attributes on nested elements in HtmlAttributes · Issue #1755 · cuba-platform/cuba · GitHub

Hi Yuriy,
Thanks again for your fast response and clear answer.
Kind regards,
Thierry