我正在尝试在我的谷歌插件中使用功能策略,串行。我在尝试在 iframe 中启用此特定功能策略时遇到了困难,我认为主要是因为父 iframe 没有启用它。下面是 iframe DOM 树的样子。我无法直接访问“sandboxFrame”和“userHtmlFrame”,因此无法更改其允许的功能。即使我在大多数子 iframe 中设置了“串行”,我也找不到在其 featurePolicy 中启用的“串行”功能。
<iframe id="sandboxFrame" allow="accelerometer *; ambient-light-sensor *; autoplay *; camera *; clipboard-read *; clipboard-write *; encrypted-media *; fullscreen *; geolocation *; gyroscope *; magnetometer *; microphone *; midi *; payment *; picture-in-picture *; screen-wake-lock *; speaker *; sync-xhr *; usb *; web-share *; vibrate *; vr *" sandbox="allow-downloads allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts" src="https://...-script.googleusercontent.com/...">
<iframe id="userHtmlFrame" allow="accelerometer *; ambient-light-sensor *; autoplay
*; camera *; clipboard-read *; clipboard-write *; encrypted-media *; fullscreen *;
geolocation *; gyroscope *; magnetometer *; microphone *; midi *; payment *; picture-
in-picture *; screen-wake-lock *; speaker *; sync-xhr *; usb *; web-share *; vibrate
*; vr *" src="/blank" title="">
<iframe id="myIframe" allow="serial *;" sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts" src="...external website in
GitHub Pages">
...
</iframe>
</iframe>
</iframe>
如果任何熟悉谷歌附加组件的人都可以证明我对任何很棒的事情都是错误的。我将不胜感激任何帮助。
谢谢你。