我要怎么在页面中新建的iframe 能加上allow="clipboard-read; clipboard-write" 这个参数

iframe 标签加 上allow=“clipboard-read; clipboard-write” 这个参数

内置 Iframe 区块的「Allow」是固定下拉项(autoplay、camera、geolocation 等),没有 clipboard-read / clipboard-write,所以选不到。可以改用 JS 区块手动创建 iframe 再设置属性:

const iframe = document.createElement(‘iframe’);
iframe.src = ‘目标地址’;
iframe.setAttribute(‘allow’, ‘clipboard-read; clipboard-write’);
iframe.style.cssText = ‘width:100%;height:100%;border:0’;
ctx.element.replaceChildren(iframe);

参考 Iframe 区块嵌入 - NocoBase 文档