Googleフォームをiframeに埋め込んだら「[Report Only] Refused to frame 'https://docs.google.com/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'none'".」と言われた【GoogleForm/iframe】
![Googleフォームをiframeに埋め込んだら「[Report Only] Refused to frame 'https://docs.google.com/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'none'".」と言われた【GoogleForm/iframe】](https://storage.googleapis.com/newt-files/35367c82-8d22-4cef-bd84-f74698497a67%2F2023-02-02_700x420.png)
表題にある通りGoogleフォームで作成したフォームのURLをコピペしてiframeで埋め込んで表示させたら
[Report Only] Refused to frame 'https://docs.google.com/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'none'".
と言われてしまい、ググっても一発で出てこなかったので解消方法の備忘録です。
結論
結論としてはシンプルで、フォームのURLに?embedded=true
を付ければokです。
当たり前すぎてググっても出てこなかったのかもしれません。
ちなみに、Googleフォームの作成画面で送信ボタンをクリックして出てくるリンク等をコピーできるモーダル内で、iframeのコードをコピーすれば最初からembeddedパラメータは付いています。
今回は↓のようにリンクをコピーしてiframeに使用した場合に発生する事象になります。
以上。
Share this post