我正在尝试在我的google插件中使用一个特性策略,串行策略。我很难在iframe中启用这个特定的特性策略,我认为主要是因为父iframes没有启用它。下面是iframe树的样子。我无法直接访问"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>如果任何熟悉谷歌插件的人都能证明我错了,那就太棒了。任何帮助我都会感激的。
谢谢。
发布于 2021-06-09 16:22:45
<iframe scr='https://example.com' allow="fullscreen 'self'">
`// the permission for fullscreen is 'self' (== http://example.com)` `// but main thing is this is that iframe HAS that permission, therefore` `// it can grant it to any nested context with ANY origin:``<iframe src='https://www.youtube.com' allow="fullscreen https://www.youtube.com">` `// will get permission of fullscreen mode for https://www.youtube.com origin``</iframe>`</iframe>
https://stackoverflow.com/questions/67907540
复制相似问题