首页 文章

为所有iframe自动添加'allowfullscreen' param是否安全?

提问于
浏览
1

我通过iframes在WordPress网站上通过短代码嵌入外部内容,如下所示:

[iframe src="http://path.to/page"]

和所有其他参数(宽度,高度,框架边框等)自动添加(内容解析和执行此类短代码),因为不需要每次都指定它们 .

一些iframe嵌入是来自YouTube或Vimeo的视频,其iframe代码需要“allowfullscreen”参数 .

所以我决定为网站上的每个iframe(甚至不是YouTube或Vimeo)自动添加'allowfullscreen',以便更轻松地添加内容 .

Is it safe to add 'allowfullscreen' param automatically for all iframes? 在网站上的所有iframe中'allowfullscreen'是否存在任何问题?

1 回答

  • -1

    allowfullscreen 似乎没有通过W3C Validator Check,即使对于YouTube也是如此;我明白了:

    Line 129, Column 131: "allowfullscreen" is not a member of a group specified for any attribute
    …bed/uIQFKwurSPM?feature=oembed" frameborder="0" allowfullscreen></iframe>

相关问题