File: articles/2023-02-02.md1.1Kmarkdown
---
date: tags: [#it-lifehack]
---
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フォームで作成したフォームの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: