How to embed a Google Form?

I’ve been trying without success to embed a Google Form. The embed code provided by Google Forms is an iframe. Is this compatible with Discourse?

「いいね!」 1

It is - you’ll have to allow the https://docs.google.com as the source domain prefix in allowed iframes.

Search for iframe in your Discourse settings.

「いいね!」 11

Works great. Thanks.

「いいね!」 2

Good to know. What are the risks connected to whitelisting https://docs.google.com for iframes? It’s a pretty huge and diverse domain…

I don’t know. Perhaps someone from the Discourse team can answer how iframes are walled off from the application.

Whitelisting could be narrowed down to the specific form, though. For example, this will work as an allowed iframe source:

https://docs.google.com/forms/d/e/1FAIpQLSfshJKrg_toMlnQtiUeBILwdiCTQhs54z7xHgzbRVuiQyJ6I/viewform

The full source from Google for the example above would be:

<iframe src="https://docs.google.com/forms/d/e/1FAIpQLSfshJKrg_toMlnQtiUeBILwdiCTQhs54z7xHgzbRVuiQyJ6I/viewform?embedded=true" width="760" height="500" frameborder="0" marginheight="0" marginwidth="0">Loading...</iframe>

「いいね!」 4

これを有効にしましたが、まだ埋め込まれていません。

iframeタグで囲みましたか?

はい、そうしました。
許可されたiframeについて話していますよね?

こんにちは、AryaMさん :slight_smile:

設定が正しく行われていることを確認するための、詳細なステップバイステップの手順を以下に示します。

Discourseの設定で:

  1. allowed iframes 設定に https://docs.google.com を追加します:

Googleフォームから:

  1. 「送信」をクリックします:

  2. <iframe> (iframe) ボタンをクリックします:


    そしてiframeコードをコピーします。

Discourseで:

  1. iframeコードを投稿に貼り付けます:
「いいね!」 4